Решение на Втора задача от Звездалина Димитрова
Обратно към всички решения
Към профила на Звездалина Димитрова
Резултати
- 5 точки от тестове
- 0 бонус точки
- 5 точки общо
- 18 успешни тест(а)
- 6 неуспешни тест(а)
Код
Лог от изпълнението
.........F.......F.FFF.F
Failures:
1) NumberSet can filter by integer type
Failure/Error: filtered_numbers = numbers[using]
NameError:
uninitialized constant TypeFilter::Intager
# /tmp/d20141028-18133-1w5isik/solution.rb:64:in `block in initialize'
# /tmp/d20141028-18133-1w5isik/solution.rb:29:in `call'
# /tmp/d20141028-18133-1w5isik/solution.rb:29:in `block in []'
# /tmp/d20141028-18133-1w5isik/solution.rb:28:in `each'
# /tmp/d20141028-18133-1w5isik/solution.rb:28:in `[]'
# /tmp/d20141028-18133-1w5isik/spec.rb:179:in `can_filter'
# /tmp/d20141028-18133-1w5isik/spec.rb:49: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: filtered_numbers = numbers[using]
NameError:
undefined local variable or method `alter' for #<Filter:0xba776180>
# /tmp/d20141028-18133-1w5isik/solution.rb:46:in `block in |'
# /tmp/d20141028-18133-1w5isik/solution.rb:29:in `call'
# /tmp/d20141028-18133-1w5isik/solution.rb:29:in `block in []'
# /tmp/d20141028-18133-1w5isik/solution.rb:28:in `each'
# /tmp/d20141028-18133-1w5isik/solution.rb:28:in `[]'
# /tmp/d20141028-18133-1w5isik/spec.rb:179:in `can_filter'
# /tmp/d20141028-18133-1w5isik/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)>'
3) NumberSet can combine multiple filters with "or" rule
Failure/Error: filtered_numbers = numbers[using]
NameError:
undefined local variable or method `alter' for #<Filter:0xba7741f0>
# /tmp/d20141028-18133-1w5isik/solution.rb:46:in `block in |'
# /tmp/d20141028-18133-1w5isik/solution.rb:29:in `call'
# /tmp/d20141028-18133-1w5isik/solution.rb:29:in `block in []'
# /tmp/d20141028-18133-1w5isik/solution.rb:28:in `each'
# /tmp/d20141028-18133-1w5isik/solution.rb:28:in `[]'
# /tmp/d20141028-18133-1w5isik/spec.rb:179:in `can_filter'
# /tmp/d20141028-18133-1w5isik/spec.rb:119: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: filtered_numbers = numbers[using]
NameError:
undefined local variable or method `alter' for #<Filter:0xba6ff724>
# /tmp/d20141028-18133-1w5isik/solution.rb:46:in `block in |'
# /tmp/d20141028-18133-1w5isik/solution.rb:29:in `call'
# /tmp/d20141028-18133-1w5isik/solution.rb:29:in `block in []'
# /tmp/d20141028-18133-1w5isik/solution.rb:28:in `each'
# /tmp/d20141028-18133-1w5isik/solution.rb:28:in `[]'
# /tmp/d20141028-18133-1w5isik/spec.rb:179:in `can_filter'
# /tmp/d20141028-18133-1w5isik/spec.rb:129: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", "or" and parenthesis
Failure/Error: filtered_numbers = numbers[using]
NameError:
undefined local variable or method `alter' for #<SignFilter:0xba6feb6c>
# /tmp/d20141028-18133-1w5isik/solution.rb:46:in `block in |'
# /tmp/d20141028-18133-1w5isik/solution.rb:42:in `call'
# /tmp/d20141028-18133-1w5isik/solution.rb:42:in `block in &'
# /tmp/d20141028-18133-1w5isik/solution.rb:29:in `call'
# /tmp/d20141028-18133-1w5isik/solution.rb:29:in `block in []'
# /tmp/d20141028-18133-1w5isik/solution.rb:28:in `each'
# /tmp/d20141028-18133-1w5isik/solution.rb:28:in `[]'
# /tmp/d20141028-18133-1w5isik/spec.rb:179:in `can_filter'
# /tmp/d20141028-18133-1w5isik/spec.rb:139: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-1w5isik/solution.rb:23:in `block in each'
# /tmp/d20141028-18133-1w5isik/solution.rb:23:in `each'
# /tmp/d20141028-18133-1w5isik/solution.rb:23:in `each'
# /tmp/d20141028-18133-1w5isik/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.02331 seconds
24 examples, 6 failures
Failed examples:
rspec /tmp/d20141028-18133-1w5isik/spec.rb:48 # NumberSet can filter by integer type
rspec /tmp/d20141028-18133-1w5isik/spec.rb:97 # NumberSet can combine two filters with "or" rule
rspec /tmp/d20141028-18133-1w5isik/spec.rb:114 # NumberSet can combine multiple filters with "or" rule
rspec /tmp/d20141028-18133-1w5isik/spec.rb:124 # NumberSet can combine multiple filters with "and" and "or" rules
rspec /tmp/d20141028-18133-1w5isik/spec.rb:134 # NumberSet can combine multiple filters with "and", "or" and parenthesis
rspec /tmp/d20141028-18133-1w5isik/spec.rb:159 # NumberSet returns enumerable of set's contents if no block is given to each
История (1 версия и 0 коментара)
Звездалина обнови решението на 27.10.2014 16:36 (преди около 10 години)