Решение на Трета задача от Росен Рачев
Обратно към всички решения
Към профила на Росен Рачев
Резултати
- 5 точки от тестове
- 0 бонус точки
- 5 точки общо
- 57 успешни тест(а)
- 12 неуспешни тест(а)
Код
Лог от изпълнението
........F.F..F.F.........................FFFF..FF.......F...F........
Failures:
1) Graphics Canvas drawing of shapes and rasterization renders multiple drawn shapes
Failure/Error: ascii.should eq rendering(expected)
expected: "@@@@@@@@@@@@@@@\n@-------------@\n@-@@@@@@@@@@@-@\n@-@---------@-@\n@-@------@@-@-@\n@-@---@@@---@-@\n@-@-@@------@-@\n@-@---------@-@\n@-@-@@@@----@-@\n@-@-@-------@-@\n@-@---------@-@\n@-@---------@-@\n@-@@@@@@@@@@@-@\n@-------------@\n@@@@@@@@@@@@@@@"
got: "@@@@@@@@@@@@@@@\n@-------------@\n@-@@@@@@@@@@@-@\n@-@---------@-@\n@-@-----@@@-@-@\n@-@--@@@----@-@\n@-@-@-------@-@\n@-@---------@-@\n@-@-@@@@----@-@\n@-@-@-------@-@\n@-@---------@-@\n@-@---------@-@\n@-@@@@@@@@@@@-@\n@-------------@\n@@@@@@@@@@@@@@@"
(compared using ==)
Diff:
@@ -2,9 +2,9 @@
@-------------@
@-@@@@@@@@@@@-@
@-@---------@-@
-@-@------@@-@-@
-@-@---@@@---@-@
-@-@-@@------@-@
+@-@-----@@@-@-@
+@-@--@@@----@-@
+@-@-@-------@-@
@-@---------@-@
@-@-@@@@----@-@
@-@-@-------@-@
# /tmp/d20131223-4637-1tz38c6/spec.rb:624:in `check_rendering_of'
# /tmp/d20131223-4637-1tz38c6/spec.rb:211:in `block (4 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) Graphics Canvas drawing of shapes and rasterization of points works for multiple ones
Failure/Error: canvas.set_pixel 4, 4
NoMethodError:
undefined method `[]=' for nil:NilClass
# /tmp/d20131223-4637-1tz38c6/solution.rb:12:in `set_pixel'
# /tmp/d20131223-4637-1tz38c6/spec.rb:57:in `block (5 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) Graphics Canvas drawing of shapes and rasterization of lines works with lines with a small slope
Failure/Error: ascii.should eq rendering(expected)
expected: "----------\n-@@-------\n---@@@@---\n-------@@-\n----------"
got: "----------\n-@--------\n--@@@@----\n------@@@-\n----------"
(compared using ==)
Diff:
@@ -1,6 +1,6 @@
----------
--@@-------
----@@@@---
--------@@-
+-@--------
+--@@@@----
+------@@@-
----------
# /tmp/d20131223-4637-1tz38c6/spec.rb:624:in `check_rendering_of'
# /tmp/d20131223-4637-1tz38c6/spec.rb:100:in `block (5 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) Graphics Canvas drawing of shapes and rasterization of lines works with multiple lines
Failure/Error: ascii.should eq rendering(expected)
expected: "-@--------\n-@@-------\n-@-@@@@---\n-@-----@@-\n----------"
got: "-@--------\n-@--------\n-@@@@@----\n-@----@@@-\n----------"
(compared using ==)
Diff:
@@ -1,6 +1,6 @@
-@--------
--@@-------
--@-@@@@---
--@-----@@-
+-@--------
+-@@@@@----
+-@----@@@-
----------
# /tmp/d20131223-4637-1tz38c6/spec.rb:624:in `check_rendering_of'
# /tmp/d20131223-4637-1tz38c6/spec.rb:132:in `block (5 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) Graphics shapes Line initialization with swapped points puts the leftmost point in the from field
Failure/Error: inverted_line.from.x.should eq 1
expected: 1
got: 25
(compared using ==)
# /tmp/d20131223-4637-1tz38c6/spec.rb:402:in `block (6 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) Graphics shapes Line initialization with swapped points puts the rightmost point in the to field
Failure/Error: inverted_line.to.x.should eq 25
expected: 25
got: 1
(compared using ==)
# /tmp/d20131223-4637-1tz38c6/spec.rb:407:in `block (6 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) Graphics shapes Line initialization with swapped points puts the top point of vertical lines in the from field
Failure/Error: vertical_line.from.y.should eq 1
expected: 1
got: 8
(compared using ==)
# /tmp/d20131223-4637-1tz38c6/spec.rb:413:in `block (6 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) Graphics shapes Line initialization with swapped points puts the bottom point of vertical lines in the to field
Failure/Error: vertical_line.to.y.should eq 8
expected: 8
got: 1
(compared using ==)
# /tmp/d20131223-4637-1tz38c6/spec.rb:418:in `block (6 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) Graphics shapes Line comparison for equality is true if line ends are the same, even if swapped
Failure/Error: (a == b).should be_true
expected: true value
got: false
# /tmp/d20131223-4637-1tz38c6/spec.rb:442:in `block (5 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) Graphics shapes Line comparison for equality is true if line is vertical and the bottom is given first
Failure/Error: (a == b).should be_true
expected: true value
got: false
# /tmp/d20131223-4637-1tz38c6/spec.rb:449:in `block (5 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)>'
11) Graphics shapes Rectangle initialization puts the leftmost point in its left field
Failure/Error: rect.left.x.should eq 4
expected: 4
got: 7
(compared using ==)
# /tmp/d20131223-4637-1tz38c6/spec.rb:507:in `block (5 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)>'
12) Graphics shapes Rectangle comparison for equality is true for rectangles defined with different diagonal corners
Failure/Error: (a == b).should be_true
expected: true value
got: false
# /tmp/d20131223-4637-1tz38c6/spec.rb:540:in `block (5 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.08676 seconds
69 examples, 12 failures
Failed examples:
rspec /tmp/d20131223-4637-1tz38c6/spec.rb:203 # Graphics Canvas drawing of shapes and rasterization renders multiple drawn shapes
rspec /tmp/d20131223-4637-1tz38c6/spec.rb:51 # Graphics Canvas drawing of shapes and rasterization of points works for multiple ones
rspec /tmp/d20131223-4637-1tz38c6/spec.rb:96 # Graphics Canvas drawing of shapes and rasterization of lines works with lines with a small slope
rspec /tmp/d20131223-4637-1tz38c6/spec.rb:127 # Graphics Canvas drawing of shapes and rasterization of lines works with multiple lines
rspec /tmp/d20131223-4637-1tz38c6/spec.rb:401 # Graphics shapes Line initialization with swapped points puts the leftmost point in the from field
rspec /tmp/d20131223-4637-1tz38c6/spec.rb:406 # Graphics shapes Line initialization with swapped points puts the rightmost point in the to field
rspec /tmp/d20131223-4637-1tz38c6/spec.rb:411 # Graphics shapes Line initialization with swapped points puts the top point of vertical lines in the from field
rspec /tmp/d20131223-4637-1tz38c6/spec.rb:416 # Graphics shapes Line initialization with swapped points puts the bottom point of vertical lines in the to field
rspec /tmp/d20131223-4637-1tz38c6/spec.rb:438 # Graphics shapes Line comparison for equality is true if line ends are the same, even if swapped
rspec /tmp/d20131223-4637-1tz38c6/spec.rb:445 # Graphics shapes Line comparison for equality is true if line is vertical and the bottom is given first
rspec /tmp/d20131223-4637-1tz38c6/spec.rb:504 # Graphics shapes Rectangle initialization puts the leftmost point in its left field
rspec /tmp/d20131223-4637-1tz38c6/spec.rb:536 # Graphics shapes Rectangle comparison for equality is true for rectangles defined with different diagonal corners
История (4 версии и 2 коментара)
Росен обнови решението на 18.12.2013 00:28 (преди почти 11 години)
Росен обнови решението на 19.12.2013 00:17 (преди почти 11 години)
Росен обнови решението на 21.12.2013 19:01 (преди почти 11 години)
Росен обнови решението на 22.12.2013 01:18 (преди почти 11 години)