Permalink
Browse files

Nicer diff error messages by using exact matching rather than regexp …

…matching
  • Loading branch information...
1 parent b68ce60 commit 8f1b879df100ccafef1acb4cbb750c362f42bb53 @josephwilk committed Sep 26, 2010
Showing with 34 additions and 29 deletions.
  1. +33 −24 features/mosaic.feature
  2. +1 −5 features/step_definitions/mosaic_steps.rb
View
@@ -15,11 +15,12 @@ Feature: Japanese Mosaic logic puzzle
| | | |
"""
When I run mosaic start_grid
- Then the output should contain:
+ Then the output should contain exactly:
"""
| | | |
| | | |
- | | | |
+ | | | |
+
"""
Scenario: Corner cell
@@ -30,11 +31,12 @@ Feature: Japanese Mosaic logic puzzle
| | | |
"""
When I run mosaic start_grid
- Then the output should contain:
+ Then the output should contain exactly:
"""
|#|#| |
|#|#| |
- | | | |
+ | | | |
+
"""
Scenario: Centre cell
@@ -43,13 +45,15 @@ Feature: Japanese Mosaic logic puzzle
| | | |
| |9| |
| | | |
+
"""
When I run mosaic start_grid
- Then the output should contain:
+ Then the output should contain exactly:
"""
- |#|#|#|
- |#|#|#|
- |#|#|#|
+ |#|#|#|
+ |#|#|#|
+ |#|#|#|
+
"""
Scenario: Side cell
@@ -60,11 +64,12 @@ Feature: Japanese Mosaic logic puzzle
| | | |
"""
When I run mosaic start_grid
- Then the output should contain:
+ Then the output should contain exactly:
"""
- |#|#| |
- |#|#| |
- |#|#| |
+ |#|#| |
+ |#|#| |
+ |#|#| |
+
"""
Scenario: 0 overriding a numeric cell
@@ -75,11 +80,12 @@ Feature: Japanese Mosaic logic puzzle
|0| | |
"""
When I run mosaic start_grid
- Then the output should contain:
+ Then the output should contain exactly:
"""
| | |#|
| | |#|
- | | |#|
+ | | |#|
+
"""
Scenario: 3x3 grid with multiple cells
@@ -90,11 +96,12 @@ Feature: Japanese Mosaic logic puzzle
|2| |2|
"""
When I run mosaic start_grid
- Then the output should contain:
+ Then the output should contain exactly:
"""
| |#| |
|#| |#|
| |#| |
+
"""
Scenario: Easy 5x5 grid
@@ -104,16 +111,17 @@ Feature: Japanese Mosaic logic puzzle
| |9| | | |
| |8|8| | |
| | | | |4|
- |4| |5| |2|
+ |4| |5| |2|
"""
When I run mosaic start_grid
- Then the output should contain:
+ Then the output should contain exactly:
"""
- |#|#|#| | |
- |#|#|#|#| |
- |#|#|#|#|#|
- |#|#| |#| |
- |#|#|#|#| |
+ |#|#|#| | |
+ |#|#|#|#| |
+ |#|#|#|#|#|
+ |#|#| |#| |
+ |#|#|#|#| |
+
"""
Scenario: Hard 5x5 grid
@@ -123,14 +131,15 @@ Feature: Japanese Mosaic logic puzzle
| |4| |6| |
|3| |7|6| |
| |6| |6|5|
- | | | | |3|
+ | | | | |3|
"""
When I run mosaic start_grid
- Then the output should contain:
+ Then the output should contain exactly:
"""
| | |#|#| |
| | |#|#| |
|#|#| |#|#|
| |#|#|#| |
|#|#| |#|#|
+
"""
@@ -1,7 +1,3 @@
When /^I run mosaic (.*)$/ do |args|
run(unescape("../../bin/mosaic #{args}"), false)
-end
-
-Then /^the output should contain the grid:$/ do |output|
- combined_output.strip.should include(output.strip)
-end
+end

0 comments on commit 8f1b879

Please sign in to comment.