Решение на Втора задача от Мартина Радева
Обратно към всички решения
Към профила на Мартина Радева
Резултати
- 5 точки от тестове
- 0 бонус точки
- 5 точки общо
- 18 успешни тест(а)
- 6 неуспешни тест(а)
Код
Лог от изпълнението
................FFFFFF..
Failures:
1) NumberSet can combine two filters with "and" rule
Failure/Error: filter = SignFilter.new(:non_negative) & Filter.new { |number| number != 0 }
NoMethodError:
undefined method `&' for #<SignFilter:0xb8b91cf8 @data_type=:non_negative>
# /tmp/d20141028-18133-jkvms4/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)>'
2) NumberSet can combine two filters with "or" rule
Failure/Error: filter = Filter.new { |number| number % 2 == 0 } | Filter.new { |number| number > 5 }
NoMethodError:
undefined method `|' for #<Filter:0xb8b91000>
# /tmp/d20141028-18133-jkvms4/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)>'
3) NumberSet can combine multiple filters with "and" rule
Failure/Error: filter = non_negative & non_zero & mod_3_is_zero
NoMethodError:
undefined method `&' for #<SignFilter:0xb8b90434 @data_type=:non_negative>
# /tmp/d20141028-18133-jkvms4/spec.rb:108: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 "or" rule
Failure/Error: filter = even | negative | more_than_100
NoMethodError:
undefined method `|' for #<Filter:0xb8bf3a98 @filter=#<Proc:0xb8bf3ad4>>
# /tmp/d20141028-18133-jkvms4/spec.rb:118: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 "and" and "or" rules
Failure/Error: filter = even & negative | mod_3_is_zero
NoMethodError:
undefined method `&' for #<Filter:0xb8bf2f80 @filter=#<Proc:0xb8bf3ad4>>
# /tmp/d20141028-18133-jkvms4/spec.rb:128: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", "or" and parenthesis
Failure/Error: filter = even & (negative | mod_3_is_zero)
NoMethodError:
undefined method `|' for #<SignFilter:0xb8bf247c @data_type=:negative>
# /tmp/d20141028-18133-jkvms4/spec.rb:138: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.0212 seconds
24 examples, 6 failures
Failed examples:
rspec /tmp/d20141028-18133-jkvms4/spec.rb:90 # NumberSet can combine two filters with "and" rule
rspec /tmp/d20141028-18133-jkvms4/spec.rb:97 # NumberSet can combine two filters with "or" rule
rspec /tmp/d20141028-18133-jkvms4/spec.rb:104 # NumberSet can combine multiple filters with "and" rule
rspec /tmp/d20141028-18133-jkvms4/spec.rb:114 # NumberSet can combine multiple filters with "or" rule
rspec /tmp/d20141028-18133-jkvms4/spec.rb:124 # NumberSet can combine multiple filters with "and" and "or" rules
rspec /tmp/d20141028-18133-jkvms4/spec.rb:134 # NumberSet can combine multiple filters with "and", "or" and parenthesis
История (4 версии и 10 коментара)
Мартина обнови решението на 26.10.2014 00:57 (преди около 10 години)
Мартина обнови решението на 27.10.2014 00:33 (преди около 10 години)
Мартина обнови решението на 27.10.2014 08:42 (преди около 10 години)
Мартина обнови решението на 27.10.2014 16:31 (преди около 10 години)