#405 √ wontfix
Paul Barry

Allow should in as a shortcut for it "should..."

Reported by Paul Barry | May 21st, 2008 @ 03:25 AM | in No-Milestone-Assigned

I find that 95% of my specs are it "should...". Also, sometimes the it doesn't even make sense:

describe "my_method" do
  it "should be wonderful" 
end

The spec is "my_method should be wonderful", not "my_method it should be wonderful".

What about adding this syntax?

describe "my_method" do
  should "be wonderful"
end

Which is trivial to support with:

module Spec::Example::ExampleGroupMethods
  def should(spec, &block)
    it("should #{spec}", &block)
  end
end

Comments and changes to this ticket

  • Pat Maddox

    Pat Maddox May 21st, 2008 @ 07:00 AM

    The spec is "my_method should be wonderful", not "my_method it should be wonderful"

    It's also not "describe my_method should be wonderful."

    I think the it makes perfect sense syntactically. "Tell me something about my_method." "Well, it should be wonderful." And the formatters turn that into a nice sentence - "my_method should be wonderful"

    Anyway, I would prefer not to add more syntax to rspec core. And as you said, it's a trivial three lines that people can drop in spec_helper if they really want.

    Anyone else care to weigh in?

  • Pat Maddox

    Pat Maddox July 19th, 2008 @ 09:08 AM

    • → State changed from “new” to “wontfix”
    • → Tag changed from “” to “featurerequest”

    Seems to be a stale ticket. Closing.

Please Login or create a free account to add a new comment.

You can update this ticket by sending an email to from your email client. (help)

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Behaviour Driven Development for Ruby.

Shared Ticket Bins

People watching this ticket