Module: Kernel

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

Instance Method Summary collapse

Instance Method Details

#context_before_on_test_specObject



64
# File 'lib/test/spec/rails.rb', line 64

alias :context_before_on_test_spec :context

#share(name, &specs_block) ⇒ Object

Stores the passed in block for inclusion in test cases.

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


21
22
23
# File 'lib/test/spec/share.rb', line 21

def share(name, &specs_block)
  $shared_specs[name] = specs_block
end

#xcontext_before_on_test_specObject



65
# File 'lib/test/spec/rails.rb', line 65

alias :xcontext_before_on_test_spec :xcontext