public
Description: Behaviour Driven Development framework for Ruby
Homepage: http://rspec.info
Clone URL: git://github.com/dchelimsky/rspec.git
Click here to lend your support to: rspec and make a donation at www.pledgie.com !
fixing newline bug when StepMother is creating unimplemented steps
bmabey (author)
Tue Aug 12 16:39:35 -0700 2008
David Chelimsky (committer)
Fri Aug 22 06:08:05 -0700 2008
commit  fad8a558297642e1939950793c8ef20d529a352e
tree    ba354bc093ab66f3cac59f6b9370b186ebcbd4ba
parent  7113bc343095637e1f6649d55deed21edccaa077
...
13
14
15
16
 
 
17
18
19
...
13
14
15
 
16
17
18
19
20
0
@@ -13,7 +13,8 @@ module Spec
0
         @steps.add(type, step)
0
       end
0
       
0
-      def find(type, name)
0
+      def find(type, unstripped_name)
0
+        name = unstripped_name.strip
0
         if @steps.find(type, name).nil?
0
           @steps.add(type,
0
           Step.new(name) do
...
42
43
44
 
 
 
 
 
 
 
 
 
 
 
 
45
46
47
...
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
0
@@ -42,6 +42,18 @@ module Spec
0
         end.should raise_error(Spec::Example::ExamplePendingError, /Unimplemented/)
0
       end
0
       
0
+      it "should create a default step with it's name stripped" do
0
+        # given
0
+        step_mother = StepMother.new
0
+        
0
+        # when
0
+        step = step_mother.find(:given, "doesn't exist\n\n")
0
+        
0
+        # then
0
+        step.should be_an_instance_of(Step)
0
+        step.name.should == "doesn't exist"
0
+      end
0
+      
0
       it 'should clear itself' do
0
         # given
0
         step_mother = StepMother.new

Comments