Module: SharedSpecsInclusionHelper

Defined in:
lib/test/spec/share.rb

Instance Method Summary collapse

Instance Method Details

#shared_specs_for(name) ⇒ Object

Include the specified shared specs in this test case.

share "User" do
  it "should authenticate" do
    "me".should == "me"
  end
end

describe "User, in general" do
  shared_specs_for 'User'
end

describe "User, in another case" do
  shared_specs_for 'User'
end

2 tests, 2 assertions, 0 failures, 0 errors


44
45
46
# File 'lib/test/spec/share.rb', line 44

def shared_specs_for(name)
  self.class_eval &$shared_specs[name]
end