Skip to content

Commit

Permalink
Add the oddly formatted Then integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
jimweirich committed Jan 11, 2014
1 parent 7b6e257 commit 651c616
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
7 changes: 7 additions & 0 deletions examples/integration/failing/oddly_formatted_then.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require 'rspec/given'

describe "arrays split over multiple lines" do
When(:result) { 'anything' }
Then { result == ['a',
'a'] }
end
7 changes: 7 additions & 0 deletions examples/integration/failing_messages_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,11 @@ def run_spec(filename)
Given(:failing_test) { "to_bool_returns_false.rb" }
Then { ios.out =~ /Failure\/Error: Then \{ ToBool.new \}/ }
end

context "with an oddly formatted then" do
Given(:failing_test) { "oddly_formatted_then.rb" }
Then { ios.out =~ /Failure\/Error: Then \{ result == \['a',$/ }
And { ios.out =~ /expected: "anything"/ }
And { ios.out =~ /to equal: \["a", "a"\]/ }
end
end
2 changes: 2 additions & 0 deletions lib/given/line_extractor.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require 'ripper'
require 'sorcerer'
require 'given/file_cache'

module Given
Expand Down

0 comments on commit 651c616

Please sign in to comment.