Решение на Трета задача от Десислав Илиев
Обратно към всички решения
Към профила на Десислав Илиев
Резултати
- 4 точки от тестове
- 0 бонус точки
- 4 точки общо
- 44 успешни тест(а)
- 25 неуспешни тест(а)
Код
Лог от изпълнението
...F..FFF.FFFFFFFFFFFFFF.FFF...........F................F.........F.F
Failures:
1) Graphics Canvas exposes its width and height via getters
Failure/Error: canvas.width.should eq 5
expected: 5
got: 10
(compared using ==)
# /tmp/d20131223-4637-12hfd38/spec.rb:18:in `block (3 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 responds to calls to set_pixel with two arguments
Failure/Error: canvas.set_pixel 1, 2
NoMethodError:
private method `set_pixel' called for #<Graphics::Canvas:0xba2275bc>
# /tmp/d20131223-4637-12hfd38/spec.rb:34:in `block (3 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 allows setting a pixel at a given x and y
Failure/Error: canvas.set_pixel(3, 5)
NoMethodError:
private method `set_pixel' called for #<Graphics::Canvas:0xba225fc8>
# /tmp/d20131223-4637-12hfd38/spec.rb:39:in `block (3 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 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: ["@@@@@@@@@@@@@@@", "@-------------@", "@-@@@@@@@@@@@-@", "@-@---------@-@", "@-@------@@-@-@", "@-@---@@@---@-@", "@-@-@@------@-@", "@-@---------@-@", "@-@-@@@@----@-@", "@-@-@-------@-@", "@-@---------@-@", "@-@---------@-@", "@-@@@@@@@@@@@-@", "@-------------@", "@@@@@@@@@@@@@@@"]
(compared using ==)
Diff:
# /tmp/d20131223-4637-12hfd38/spec.rb:624:in `check_rendering_of'
# /tmp/d20131223-4637-12hfd38/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)>'
5) Graphics Canvas drawing of shapes and rasterization of points works for multiple ones
Failure/Error: canvas.set_pixel 0, 0
NoMethodError:
private method `set_pixel' called for #<Graphics::Canvas:0xba214214>
# /tmp/d20131223-4637-12hfd38/spec.rb:53: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)>'
6) Graphics Canvas drawing of shapes and rasterization of lines works with simple horizontal lines
Failure/Error: ascii.should eq rendering(expected)
expected: "--------\n---@@@@-\n--------"
got: ["---", "---@@@@", "---", "---", "---", "---", "---", "---"]
(compared using ==)
Diff:
@@ -1,4 +1,9 @@
---------
----@@@@-
---------
+---
+---@@@@
+---
+---
+---
+---
+---
+---
# /tmp/d20131223-4637-12hfd38/spec.rb:624:in `check_rendering_of'
# /tmp/d20131223-4637-12hfd38/spec.rb:73: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)>'
7) Graphics Canvas drawing of shapes and rasterization of lines works with vertical lines
Failure/Error: ascii.should eq rendering(expected)
expected: "-@------\n-@------\n-@------\n-@------\n-@------\n-@------\n-@------\n--------"
got: ["-@------", "-@------", "-@------", "-@------", "-@------", "-@------", "-@------", "--------"]
(compared using ==)
Diff:
# /tmp/d20131223-4637-12hfd38/spec.rb:624:in `check_rendering_of'
# /tmp/d20131223-4637-12hfd38/spec.rb:84: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)>'
8) 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: ["-----", "-@@--", "---@@@", "------@@@", "-----", "-----", "-----", "-----", "-----", "-----"]
(compared using ==)
Diff:
@@ -1,6 +1,11 @@
-----------
--@@-------
----@@@@---
--------@@-
-----------
+-----
+-@@--
+---@@@
+------@@@
+-----
+-----
+-----
+-----
+-----
+-----
# /tmp/d20131223-4637-12hfd38/spec.rb:624:in `check_rendering_of'
# /tmp/d20131223-4637-12hfd38/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)>'
9) Graphics Canvas drawing of shapes and rasterization of lines works with lines with a significant slope, with swapped ends
Failure/Error: ascii.should eq rendering(expected)
expected: "----------\n-@--------\n-@--------\n--@-------\n--@-------\n--@-------\n--@-------\n---@------\n---@------\n----------"
got: ["----------", "-@--------", "-@--------", "--@-------", "--@-------", "--@-------", "---@------", "---@------", "---@------", "----------"]
(compared using ==)
Diff:
@@ -4,7 +4,7 @@
--@-------
--@-------
--@-------
---@-------
+---@------
---@------
---@------
----------
# /tmp/d20131223-4637-12hfd38/spec.rb:624:in `check_rendering_of'
# /tmp/d20131223-4637-12hfd38/spec.rb:113: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 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: ["-@---", "-@@--", "-@-@@@", "-@----@@@", "-----", "-----", "-----", "-----", "-----", "-----"]
(compared using ==)
Diff:
@@ -1,6 +1,11 @@
--@--------
--@@-------
--@-@@@@---
--@-----@@-
-----------
+-@---
+-@@--
+-@-@@@
+-@----@@@
+-----
+-----
+-----
+-----
+-----
+-----
# /tmp/d20131223-4637-12hfd38/spec.rb:624:in `check_rendering_of'
# /tmp/d20131223-4637-12hfd38/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)>'
11) Graphics Canvas drawing of shapes and rasterization of lines draws lines with two equal ends as points
Failure/Error: ascii.should eq rendering(expected)
expected: "---\n-@-\n---"
got: ["---", "-@-", "---"]
(compared using ==)
Diff:
# /tmp/d20131223-4637-12hfd38/spec.rb:624:in `check_rendering_of'
# /tmp/d20131223-4637-12hfd38/spec.rb:145: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 Canvas drawing of shapes and rasterization of rectangles works with simple rects
Failure/Error: ascii.should eq rendering(expected)
expected: "----------\n-@@@@@@@@-\n-@------@-\n-@@@@@@@@-\n----------"
got: ["-----", "-@@@@@@@@", "-@------@", "-@@@@@@@@", "-----", "-----", "-----", "-----", "-----", "-----"]
(compared using ==)
Diff:
@@ -1,6 +1,11 @@
-----------
--@@@@@@@@-
--@------@-
--@@@@@@@@-
-----------
+-----
+-@@@@@@@@
+-@------@
+-@@@@@@@@
+-----
+-----
+-----
+-----
+-----
+-----
# /tmp/d20131223-4637-12hfd38/spec.rb:624:in `check_rendering_of'
# /tmp/d20131223-4637-12hfd38/spec.rb:158: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)>'
13) Graphics Canvas drawing of shapes and rasterization of rectangles works with rects defined with their bottom left and top right points
Failure/Error: ascii.should eq rendering(expected)
expected: "----------\n-@@@@@@@@-\n-@------@-\n-@@@@@@@@-\n----------"
got: ["-----", "-@@@@@@@@", "-@------@", "-@@@@@@@@", "-----", "-----", "-----", "-----", "-----", "-----"]
(compared using ==)
Diff:
@@ -1,6 +1,11 @@
-----------
--@@@@@@@@-
--@------@-
--@@@@@@@@-
-----------
+-----
+-@@@@@@@@
+-@------@
+-@@@@@@@@
+-----
+-----
+-----
+-----
+-----
+-----
# /tmp/d20131223-4637-12hfd38/spec.rb:624:in `check_rendering_of'
# /tmp/d20131223-4637-12hfd38/spec.rb:171: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)>'
14) Graphics Canvas drawing of shapes and rasterization of rectangles works with rects with a zero height as a line
Failure/Error: ascii.should eq rendering(expected)
expected: "----------\n-@@@@@@@@-\n----------"
got: ["---", "-@@@@@@@@", "---", "---", "---", "---", "---", "---", "---", "---"]
(compared using ==)
Diff:
@@ -1,4 +1,11 @@
-----------
--@@@@@@@@-
-----------
+---
+-@@@@@@@@
+---
+---
+---
+---
+---
+---
+---
+---
# /tmp/d20131223-4637-12hfd38/spec.rb:624:in `check_rendering_of'
# /tmp/d20131223-4637-12hfd38/spec.rb:184: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)>'
15) Graphics Canvas drawing of shapes and rasterization of rectangles works with rects with a zero width and height as a single point
Failure/Error: ascii.should eq rendering(expected)
expected: "---\n-@-\n---"
got: ["---", "-@-", "---"]
(compared using ==)
Diff:
# /tmp/d20131223-4637-12hfd38/spec.rb:624:in `check_rendering_of'
# /tmp/d20131223-4637-12hfd38/spec.rb:195: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)>'
16) Graphics Renderers Ascii renders a grid of the size of the canvas
Failure/Error: lines = canvas.render_as(ascii).split("\n")
NoMethodError:
undefined method `split' for ["---", "---", "---", "---"]:Array
# /tmp/d20131223-4637-12hfd38/spec.rb:238: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)>'
17) Graphics Renderers Ascii renders blank canvases
Failure/Error: canvas.render_as(ascii).should eq rendering('
expected: "----\n----\n----"
got: ["---", "---", "---", "---"]
(compared using ==)
Diff:
@@ -1,4 +1,5 @@
-----
-----
-----
+---
+---
+---
+---
# /tmp/d20131223-4637-12hfd38/spec.rb:245: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)>'
18) Graphics Renderers Ascii renders simple canvases
Failure/Error: canvas.set_pixel 0, 0
NoMethodError:
private method `set_pixel' called for #<Graphics::Canvas:0xba187e54>
# /tmp/d20131223-4637-12hfd38/spec.rb:253: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)>'
19) Graphics Renderers Html renders a grid of the size of the canvas
Failure/Error: lines.size.should eq 3
expected: 3
got: 4
(compared using ==)
# /tmp/d20131223-4637-12hfd38/spec.rb:283: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)>'
20) Graphics Renderers Html renders simple canvases
Failure/Error: canvas.set_pixel 1, 1
NoMethodError:
private method `set_pixel' called for #<Graphics::Canvas:0xba0f804c>
# /tmp/d20131223-4637-12hfd38/spec.rb:288: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)>'
21) Graphics Renderers Html returns the same rendering when called twice
Failure/Error: canvas.set_pixel 1, 1
NoMethodError:
private method `set_pixel' called for #<Graphics::Canvas:0xba0eb158>
# /tmp/d20131223-4637-12hfd38/spec.rb:299: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)>'
22) Graphics shapes Line initialization returns its from and to points via getters
Failure/Error: line.from.x.should eq 1
expected: 1
got: 25
(compared using ==)
# /tmp/d20131223-4637-12hfd38/spec.rb:383: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)>'
23) 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-12hfd38/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)>'
24) Graphics shapes Rectangle corners top right
Failure/Error: rect.top_right.x.should eq 5
expected: 5
got: 1
(compared using ==)
# /tmp/d20131223-4637-12hfd38/spec.rb:583: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)>'
25) Graphics shapes Rectangle corners bottom left
Failure/Error: rect.bottom_left.x.should eq 1
expected: 1
got: 5
(compared using ==)
# /tmp/d20131223-4637-12hfd38/spec.rb:595: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.0963 seconds
69 examples, 25 failures
Failed examples:
rspec /tmp/d20131223-4637-12hfd38/spec.rb:16 # Graphics Canvas exposes its width and height via getters
rspec /tmp/d20131223-4637-12hfd38/spec.rb:33 # Graphics Canvas responds to calls to set_pixel with two arguments
rspec /tmp/d20131223-4637-12hfd38/spec.rb:37 # Graphics Canvas allows setting a pixel at a given x and y
rspec /tmp/d20131223-4637-12hfd38/spec.rb:203 # Graphics Canvas drawing of shapes and rasterization renders multiple drawn shapes
rspec /tmp/d20131223-4637-12hfd38/spec.rb:51 # Graphics Canvas drawing of shapes and rasterization of points works for multiple ones
rspec /tmp/d20131223-4637-12hfd38/spec.rb:69 # Graphics Canvas drawing of shapes and rasterization of lines works with simple horizontal lines
rspec /tmp/d20131223-4637-12hfd38/spec.rb:80 # Graphics Canvas drawing of shapes and rasterization of lines works with vertical lines
rspec /tmp/d20131223-4637-12hfd38/spec.rb:96 # Graphics Canvas drawing of shapes and rasterization of lines works with lines with a small slope
rspec /tmp/d20131223-4637-12hfd38/spec.rb:109 # Graphics Canvas drawing of shapes and rasterization of lines works with lines with a significant slope, with swapped ends
rspec /tmp/d20131223-4637-12hfd38/spec.rb:127 # Graphics Canvas drawing of shapes and rasterization of lines works with multiple lines
rspec /tmp/d20131223-4637-12hfd38/spec.rb:141 # Graphics Canvas drawing of shapes and rasterization of lines draws lines with two equal ends as points
rspec /tmp/d20131223-4637-12hfd38/spec.rb:154 # Graphics Canvas drawing of shapes and rasterization of rectangles works with simple rects
rspec /tmp/d20131223-4637-12hfd38/spec.rb:167 # Graphics Canvas drawing of shapes and rasterization of rectangles works with rects defined with their bottom left and top right points
rspec /tmp/d20131223-4637-12hfd38/spec.rb:180 # Graphics Canvas drawing of shapes and rasterization of rectangles works with rects with a zero height as a line
rspec /tmp/d20131223-4637-12hfd38/spec.rb:191 # Graphics Canvas drawing of shapes and rasterization of rectangles works with rects with a zero width and height as a single point
rspec /tmp/d20131223-4637-12hfd38/spec.rb:237 # Graphics Renderers Ascii renders a grid of the size of the canvas
rspec /tmp/d20131223-4637-12hfd38/spec.rb:244 # Graphics Renderers Ascii renders blank canvases
rspec /tmp/d20131223-4637-12hfd38/spec.rb:252 # Graphics Renderers Ascii renders simple canvases
rspec /tmp/d20131223-4637-12hfd38/spec.rb:280 # Graphics Renderers Html renders a grid of the size of the canvas
rspec /tmp/d20131223-4637-12hfd38/spec.rb:287 # Graphics Renderers Html renders simple canvases
rspec /tmp/d20131223-4637-12hfd38/spec.rb:298 # Graphics Renderers Html returns the same rendering when called twice
rspec /tmp/d20131223-4637-12hfd38/spec.rb:382 # Graphics shapes Line initialization returns its from and to points via getters
rspec /tmp/d20131223-4637-12hfd38/spec.rb:504 # Graphics shapes Rectangle initialization puts the leftmost point in its left field
rspec /tmp/d20131223-4637-12hfd38/spec.rb:581 # Graphics shapes Rectangle corners top right
rspec /tmp/d20131223-4637-12hfd38/spec.rb:593 # Graphics shapes Rectangle corners bottom left
История (1 версия и 0 коментара)
Десислав обнови решението на 22.12.2013 22:51 (преди почти 11 години)