Sha256: 0b668df06c18b06341141374c35be8d749251a231135bcb96554338366bdcc6e

Contents?: true

Size: 996 Bytes

Versions: 16

Compression:

Stored size: 996 Bytes

Contents

require File.dirname(__FILE__) + '/../../spec_helper.rb'

describe "ExecutionContext" do
  
  it "should provide duck_type()" do
    dt = duck_type(:length)
    dt.should be_an_instance_of(Spec::Mocks::DuckTypeArgConstraint)
    dt.matches?([]).should be_true
  end
  
  it "should provide hash_including" do
    hi = hash_including(:a => 1)
    hi.should be_an_instance_of(Spec::Mocks::HashIncludingConstraint)
    hi.matches?(:a => 1).should be_true
  end
  
  it "should violate when violated()" do
    lambda do
      violated
    end.should raise_error(Spec::Expectations::ExpectationNotMetError)
  end

  it "should provide mock()" do
    mock("thing").should be_an_instance_of(Spec::Mocks::Mock)
  end

  it "should provide stub()" do
    thing_stub = stub("thing").should be_an_instance_of(Spec::Mocks::Mock)
  end
  
  it "should add method stubs to stub()" do
    thing_stub = stub("thing", :a => "A", :b => "B")
    thing_stub.a.should == "A"
    thing_stub.b.should == "B"
  end

end

Version data entries

16 entries across 16 versions & 4 rubygems

Version Path
jnstq-acts_as_sms-0.1.0 test/vendor/plugins/rspec/spec/spec/runner/execution_context_spec.rb
jnstq-acts_as_sms-0.1.1 test/vendor/plugins/rspec/spec/spec/runner/execution_context_spec.rb
jnstq-acts_as_sms-0.1.3 test/vendor/plugins/rspec/spec/spec/runner/execution_context_spec.rb
jnstq-acts_as_sms-0.1.4 test/vendor/plugins/rspec/spec/spec/runner/execution_context_spec.rb
radiant-0.6.5.1 vendor/plugins/rspec/spec/spec/runner/execution_context_spec.rb
radiant-0.6.5 vendor/plugins/rspec/spec/spec/runner/execution_context_spec.rb
radiant-0.6.6 vendor/plugins/rspec/spec/spec/runner/execution_context_spec.rb
radiant-0.6.7 vendor/plugins/rspec/spec/spec/runner/execution_context_spec.rb
radiant-0.6.9 vendor/plugins/rspec/spec/spec/runner/execution_context_spec.rb
radiant-0.6.8 vendor/plugins/rspec/spec/spec/runner/execution_context_spec.rb
rspec-0.0.10 spec/spec/runner/execution_context_spec.rb
rspec-1.1.4 spec/spec/runner/execution_context_spec.rb
spree-0.4.0 vendor/plugins/rspec/spec/spec/runner/execution_context_spec.rb
spree-0.4.1 vendor/plugins/rspec/spec/spec/runner/execution_context_spec.rb
spree-0.5.0 vendor/plugins/rspec/spec/spec/runner/execution_context_spec.rb
spree-0.5.1 vendor/plugins/rspec/spec/spec/runner/execution_context_spec.rb