method

share_as

Importance_1
RSpec latest stable (1.3.1) - 0 notes - Class: Spec::DSL::Main
share_as(name, &block) public

Creates a Shared Example Group and assigns it to a constant

 share_as :AllEditions do
   it "should do all editions stuff" ...
 end

 describe SmallEdition do
   it_should_behave_like AllEditions

   it "should do small edition stuff" do
     ...
   end
 end

And, for those of you who prefer to use something more like Ruby, you can just include the module directly

 describe SmallEdition do
   include AllEditions

   it "should do small edition stuff" do
     ...
   end
 end
Show source
Register or log in to add new notes.