[rspec-users] feature suggestion: straight strings

David Chelimsky dchelimsky at gmail.com
Mon Dec 20 13:02:16 EST 2010


On Dec 20, 2010, at 10:56 AM, Roger Pack wrote:

> Sorry if I mentioned this one before, but has anyone proposed being able
> to do something like
> 
> 
>    "it should be able".to {
> 
>    }
> 
> ? (or something like that)...
> 
> Might be preferable where a test description doesn't start with "it"

I think ending in "to" is just as constraining as starting with "it", no?

> Thoughts?

"it" and "specify" are both aliases for "example", so you can say:

  describe "foo" do
    example "doing something or other" do
      ...
    end
end

HTH,
David


> 

> Thanks.
> -r
> 
> -- 
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users



More information about the rspec-users mailing list