[rspec-devel] [ rspec-Patches-15709 ] [PATCH] Have SimpleMatchers expose their description for specdocs

noreply at rubyforge.org noreply at rubyforge.org
Sat Nov 17 16:30:46 EST 2007


Patches item #15709, was opened at 2007-11-17 16:30
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3151&aid=15709&group_id=797

Category: expectation module
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Bryan Helmkamp (brynary)
Assigned to: Nobody (None)
Summary: [PATCH] Have SimpleMatchers expose their description for specdocs

Initial Comment:
I'm loving the simplicity of writing custom matchers with SimpleMatcher. The convenience has led me to write very descriptive matchers like "validate_presence_of(attribute)". The result is that the strings I would be passing in to the #it method are identical to my matchers. For example:

it "should validate presence of name" do
  @story.should validate_presence_of(:name)
end

I prefer to shorten these to:

it { @story.should validate_presence_of(:name) }

The problem is that SimpleMatcher doesn't expose it's description instance variable to be used in specdocs.

This simple patch fixes that.

----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3151&aid=15709&group_id=797


More information about the rspec-devel mailing list