Решение на Втора задача от Нели Василева
Обратно към всички решения
Към профила на Нели Василева
Резултати
- 4 точки от тестове
- 0 бонус точки
- 4 точки общо
- 14 успешни тест(а)
- 10 неуспешни тест(а)
Код
Лог от изпълнението
...F....FFF.....FFFFFF..
Failures:
1) NumberSet can store rational numbers
Failure/Error: expect(numbers).to include and_get_it_as
expected #<NumberSet: {3.142857142857143}> to include (22/7)
# /tmp/d20141028-18133-1o63gpu/spec.rb:171:in `can_store'
# /tmp/d20141028-18133-1o63gpu/spec.rb:15: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 filter by complex type
Failure/Error: expect(filtered_numbers.size).to eq expecting.size
expected: 1
got: 0
(compared using ==)
# /tmp/d20141028-18133-1o63gpu/spec.rb:180:in `can_filter'
# /tmp/d20141028-18133-1o63gpu/spec.rb:43: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 filter by integer type
Failure/Error: expect(filtered_numbers.size).to eq expecting.size
expected: 1
got: 0
(compared using ==)
# /tmp/d20141028-18133-1o63gpu/spec.rb:180:in `can_filter'
# /tmp/d20141028-18133-1o63gpu/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)>'
4) NumberSet can filter by real type
Failure/Error: expect(filtered_numbers.size).to eq expecting.size
expected: 2
got: 0
(compared using ==)
# /tmp/d20141028-18133-1o63gpu/spec.rb:180:in `can_filter'
# /tmp/d20141028-18133-1o63gpu/spec.rb:55: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 two filters with "and" rule
Failure/Error: expect(filtered_numbers.size).to eq expecting.size
expected: 1
got: 2
(compared using ==)
# /tmp/d20141028-18133-1o63gpu/spec.rb:180:in `can_filter'
# /tmp/d20141028-18133-1o63gpu/spec.rb:92: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 two filters with "or" rule
Failure/Error: expect(filtered_numbers.size).to eq expecting.size
expected: 7
got: 5
(compared using ==)
# /tmp/d20141028-18133-1o63gpu/spec.rb:180:in `can_filter'
# /tmp/d20141028-18133-1o63gpu/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)>'
7) NumberSet can combine multiple filters with "and" rule
Failure/Error: expect(filtered_numbers.size).to eq expecting.size
expected: 5
got: 7
(compared using ==)
# /tmp/d20141028-18133-1o63gpu/spec.rb:180:in `can_filter'
# /tmp/d20141028-18133-1o63gpu/spec.rb:109: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 can combine multiple filters with "or" rule
Failure/Error: expect(filtered_numbers.size).to eq expecting.size
expected: 11
got: 7
(compared using ==)
# /tmp/d20141028-18133-1o63gpu/spec.rb:180:in `can_filter'
# /tmp/d20141028-18133-1o63gpu/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)>'
9) NumberSet can combine multiple filters with "and" and "or" rules
Failure/Error: expect(filtered_numbers.size).to eq expecting.size
expected: 8
got: 3
(compared using ==)
# /tmp/d20141028-18133-1o63gpu/spec.rb:180:in `can_filter'
# /tmp/d20141028-18133-1o63gpu/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)>'
10) NumberSet can combine multiple filters with "and", "or" and parenthesis
Failure/Error: expect(filtered_numbers.size).to eq expecting.size
expected: 4
got: 3
(compared using ==)
# /tmp/d20141028-18133-1o63gpu/spec.rb:180:in `can_filter'
# /tmp/d20141028-18133-1o63gpu/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)>'
Finished in 0.02493 seconds
24 examples, 10 failures
Failed examples:
rspec /tmp/d20141028-18133-1o63gpu/spec.rb:14 # NumberSet can store rational numbers
rspec /tmp/d20141028-18133-1o63gpu/spec.rb:42 # NumberSet can filter by complex type
rspec /tmp/d20141028-18133-1o63gpu/spec.rb:48 # NumberSet can filter by integer type
rspec /tmp/d20141028-18133-1o63gpu/spec.rb:54 # NumberSet can filter by real type
rspec /tmp/d20141028-18133-1o63gpu/spec.rb:90 # NumberSet can combine two filters with "and" rule
rspec /tmp/d20141028-18133-1o63gpu/spec.rb:97 # NumberSet can combine two filters with "or" rule
rspec /tmp/d20141028-18133-1o63gpu/spec.rb:104 # NumberSet can combine multiple filters with "and" rule
rspec /tmp/d20141028-18133-1o63gpu/spec.rb:114 # NumberSet can combine multiple filters with "or" rule
rspec /tmp/d20141028-18133-1o63gpu/spec.rb:124 # NumberSet can combine multiple filters with "and" and "or" rules
rspec /tmp/d20141028-18133-1o63gpu/spec.rb:134 # NumberSet can combine multiple filters with "and", "or" and parenthesis
История (1 версия и 0 коментара)
Нели обнови решението на 27.10.2014 16:00 (преди около 10 години)