Решение на Втора задача от Васил Бунарджиев
Обратно към всички решения
Към профила на Васил Бунарджиев
Резултати
- 4 точки от тестове
- 0 бонус точки
- 4 точки общо
- 16 успешни тест(а)
- 8 неуспешни тест(а)
Код
Лог от изпълнението
...........F....FFFFFF.F
Failures:
1) NumberSet can filter by custom filter
Failure/Error: can_filter [Rational(5, 2), 7.6, 5], using: Filter.new { |number| number > 4 },
NameError:
uninitialized constant Filter
# /tmp/d20141028-18133-1cxkua5/spec.rb:61:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
2) NumberSet can combine two filters with "and" rule
Failure/Error: filter = SignFilter.new(:non_negative) & Filter.new { |number| number != 0 }
NameError:
uninitialized constant Filter
# /tmp/d20141028-18133-1cxkua5/spec.rb:91:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
3) NumberSet can combine two filters with "or" rule
Failure/Error: filter = Filter.new { |number| number % 2 == 0 } | Filter.new { |number| number > 5 }
NameError:
uninitialized constant Filter
# /tmp/d20141028-18133-1cxkua5/spec.rb:98:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
4) NumberSet can combine multiple filters with "and" rule
Failure/Error: non_zero = Filter.new { |number| number != 0 }
NameError:
uninitialized constant Filter
# /tmp/d20141028-18133-1cxkua5/spec.rb:106:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
5) NumberSet can combine multiple filters with "or" rule
Failure/Error: even = Filter.new(&:even?)
NameError:
uninitialized constant Filter
# /tmp/d20141028-18133-1cxkua5/spec.rb:115:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
6) NumberSet can combine multiple filters with "and" and "or" rules
Failure/Error: even = Filter.new(&:even?)
NameError:
uninitialized constant Filter
# /tmp/d20141028-18133-1cxkua5/spec.rb:125:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
7) NumberSet can combine multiple filters with "and", "or" and parenthesis
Failure/Error: even = Filter.new(&:even?)
NameError:
uninitialized constant Filter
# /tmp/d20141028-18133-1cxkua5/spec.rb:135:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
8) NumberSet returns enumerable of set's contents if no block is given to each
Failure/Error: expect(numbers.each.to_a.size).to eq [1, 3, 5].size
LocalJumpError:
no block given (yield)
# /tmp/d20141028-18133-1cxkua5/solution.rb:23:in `block in each'
# /tmp/d20141028-18133-1cxkua5/solution.rb:23:in `each'
# /tmp/d20141028-18133-1cxkua5/solution.rb:23:in `each'
# /tmp/d20141028-18133-1cxkua5/spec.rb:164:in `block (2 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (3 levels) in <top (required)>'
# ./lib/language/ruby/run_with_timeout.rb:5:in `block (2 levels) in <top (required)>'
Finished in 0.03054 seconds
24 examples, 8 failures
Failed examples:
rspec /tmp/d20141028-18133-1cxkua5/spec.rb:60 # NumberSet can filter by custom filter
rspec /tmp/d20141028-18133-1cxkua5/spec.rb:90 # NumberSet can combine two filters with "and" rule
rspec /tmp/d20141028-18133-1cxkua5/spec.rb:97 # NumberSet can combine two filters with "or" rule
rspec /tmp/d20141028-18133-1cxkua5/spec.rb:104 # NumberSet can combine multiple filters with "and" rule
rspec /tmp/d20141028-18133-1cxkua5/spec.rb:114 # NumberSet can combine multiple filters with "or" rule
rspec /tmp/d20141028-18133-1cxkua5/spec.rb:124 # NumberSet can combine multiple filters with "and" and "or" rules
rspec /tmp/d20141028-18133-1cxkua5/spec.rb:134 # NumberSet can combine multiple filters with "and", "or" and parenthesis
rspec /tmp/d20141028-18133-1cxkua5/spec.rb:159 # NumberSet returns enumerable of set's contents if no block is given to each
История (2 версии и 0 коментара)
Васил обнови решението на 27.10.2014 14:54 (преди около 10 години)
Васил обнови решението на 27.10.2014 14:55 (преди около 10 години)