[rspec-users] ANN: RSpec 0.9.0 beta-1 available for download.

Wincent Colaiuta win at wincent.com
Thu Apr 5 14:09:16 EDT 2007


El 4/4/2007, a las 18:33, aslak hellesoy escribió:

> In order to ease the transition from 0.8 to 0.9, we have included a
> tool to translate your 0.8 style specs to 0.9 style.

The included translator did a pretty good job on a fairly large  
project ("svn diff" on the working copy after the translation yielded  
over 3,000 lines of diffs) with only a few minor issues for which  
I'll paste in samples. (Tried to post this to the RubyForge issue  
tracker but I can't stay logged in long enough to open the ticket  
because of an invisible anonymous proxy in place thanks to my ISP...)


Whitespace between specs and comments eaten:

-      lambda { @instance.foo = foo }.should_raise NoMethodError # no  
writer defined
+      lambda { @instance.foo = foo }.should raise_error 
(NoMethodError)# no writer defined


Incorrect parentheses around method invocations with parameters:

-        AndPredicate.new('foo').should_eql AndPredicate.new('foo')
+        AndPredicate.new('foo').should eql(AndPredicate.new)('foo')


Unnecessary parens:

-        Node.subclass('FooNode').should_not_be_nil
+        Node.subclass('FooNode').should_not be_nil()


Missing parentheses, yields "parenthesize argument(s) for future  
version" warnings when running specs:

-        lambda { sequence.parse 
('bar') }.should_throw :ZeroWidthParseSuccess
+        lambda { sequence.parse('bar') }.should  
throw_symbol :ZeroWidthParseSuccess


Another example:

-        @parslet.should_eql @parslet.clone
+        @parslet.should eql @parslet.clone


Another case of misplaced parens:

-        @parslet.should_not_eql lambda { nil }.to_parseable
+        @parslet.should_not eql(lambda){ nil }.to_parseable


Another:

-        results.should_be_kind_of SimpleASTLanguage::Identifier
+        results.should be_kind_of(SimpleASTLanguage)::Identifier


Apart from that, no major issues. All specs continued to pass after  
0.90, and the updated TextMate bundle works brilliantly.

Cheers,
Wincent






More information about the rspec-users mailing list