We got nominated! Help us out and vote for GitHub as Best Bootstrapped Startup of 2008. (You can vote once a day.) [ hide ]

public
Rubygem
Description: RSpec's official Ruby on Rails plugin
Clone URL: git://github.com/dchelimsky/rspec-rails.git
reduce precision of expected failure message in code example
David Chelimsky (author)
Sun Aug 24 08:19:49 -0700 2008
commit  9946c4b98adcdce017eb51a585e2b3699d4aa16e
tree    1899af33e2ffb9ff3eabb560b7adaf863ac5db50
parent  b408c45fbf4369f528bf1ed8c2ae66e5b703dfe0
...
40
41
42
43
 
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
 
 
61
62
63
64
65
66
 
 
 
 
 
 
 
67
68
69
...
40
41
42
 
43
44
45
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
0
@@ -40,30 +40,24 @@ describe "include_text", :type => :controller do
0
         response.should include_text('text for this')
0
       end
0
 
0
- it "should fail with matching text" do
0
+ it "should fail with incorrect text" do
0
         post 'text_action'
0
         lambda {
0
- response.should include_text("this is NOT the text for this action")
0
- }.should fail_with("expected to find \"this is NOT the text for this action\" in \"this is the text for this action\"")
0
- end
0
-
0
- it "should fail when a template is rendered" do
0
- post 'some_action'
0
- failure_message = case mode
0
- when 'isolation'
0
- /expected to find \"this is the text for this action\" in \"render_spec\/some_action\"/
0
- when 'integration'
0
- /expected to find \"this is the text for this action\" in \"\"/
0
- end
0
- lambda {
0
- response.should include_text("this is the text for this action")
0
- }.should fail_with(failure_message)
0
+ response.should include_text("the accordian guy")
0
+ }.should fail_with("expected to find \"the accordian guy\" in \"this is the text for this action\"")
0
       end
0
 
0
       it "should pass using should_not with incorrect text" do
0
         post 'text_action'
0
         response.should_not include_text("the accordian guy")
0
       end
0
+
0
+ it "should fail when a template is rendered" do
0
+ get 'some_action'
0
+ lambda {
0
+ response.should include_text("this is the text for this action")
0
+ }.should fail_with(/expected to find \"this is the text for this action\"/)
0
+ end
0
     end
0
   end
0
 end

Comments

    No one has commented yet.