Решение на Втора задача от Гюлджан Купен
Обратно към всички решения
Към профила на Гюлджан Купен
Резултати
- 5 точки от тестове
- 0 бонус точки
- 5 точки общо
- 18 успешни тест(а)
- 6 неуспешни тест(а)
Код
Лог от изпълнението
.................FFFF.FF
Failures:
1) NumberSet can combine two filters with "or" rule
Failure/Error: expect(filtered_numbers.size).to eq expecting.size
expected: 7
got: 10
(compared using ==)
# /tmp/d20141028-18133-ps8dy1/spec.rb:180:in `can_filter'
# /tmp/d20141028-18133-ps8dy1/spec.rb:99: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 multiple filters with "and" rule
Failure/Error: filter = non_negative & non_zero & mod_3_is_zero
NoMethodError:
undefined method `&' for #<CombineFilters:0xb96f2bec>
# /tmp/d20141028-18133-ps8dy1/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)>'
3) NumberSet can combine multiple filters with "or" rule
Failure/Error: filter = even | negative | more_than_100
NoMethodError:
undefined method `|' for #<CombineFilters:0xb96f20ac>
# /tmp/d20141028-18133-ps8dy1/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)>'
4) NumberSet can combine multiple filters with "and" and "or" rules
Failure/Error: filter = even & negative | mod_3_is_zero
NoMethodError:
undefined method `|' for #<CombineFilters:0xb96f15bc>
# /tmp/d20141028-18133-ps8dy1/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)>'
5) NumberSet is enumerable
Failure/Error: expect(values.size).to eq [Rational(5, 2), 8, 7, 9].size
expected: 4
got: 5
(compared using ==)
# /tmp/d20141028-18133-ps8dy1/spec.rb:155: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 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-ps8dy1/solution.rb:11:in `each'
# /tmp/d20141028-18133-ps8dy1/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.02155 seconds
24 examples, 6 failures
Failed examples:
rspec /tmp/d20141028-18133-ps8dy1/spec.rb:97 # NumberSet can combine two filters with "or" rule
rspec /tmp/d20141028-18133-ps8dy1/spec.rb:104 # NumberSet can combine multiple filters with "and" rule
rspec /tmp/d20141028-18133-ps8dy1/spec.rb:114 # NumberSet can combine multiple filters with "or" rule
rspec /tmp/d20141028-18133-ps8dy1/spec.rb:124 # NumberSet can combine multiple filters with "and" and "or" rules
rspec /tmp/d20141028-18133-ps8dy1/spec.rb:144 # NumberSet is enumerable
rspec /tmp/d20141028-18133-ps8dy1/spec.rb:159 # NumberSet returns enumerable of set's contents if no block is given to each
История (4 версии и 6 коментара)
Гюлджан обнови решението на 24.10.2014 22:11 (преди около 10 години)
Гюлджан обнови решението на 25.10.2014 11:43 (преди около 10 години)
Гюлджан обнови решението на 26.10.2014 10:57 (преди около 10 години)
Гюлджан обнови решението на 27.10.2014 16:24 (преди около 10 години)