Sha256: 5b70ce774b453c72b10d2ca7450046165ab497519fc721f886161ddb405f7d71

Contents?: true

Size: 802 Bytes

Versions: 39

Compression:

Stored size: 802 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 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

39 entries across 39 versions & 6 rubygems

Version Path
deckshuffler-0.0.2 vendor/plugins/rspec/spec/spec/runner/execution_context_spec.rb
has_finder-0.1.2 spec/rails/vendor/plugins/rspec/spec/spec/runner/execution_context_spec.rb
has_finder-0.1.1 spec/rails/vendor/plugins/rspec/spec/spec/runner/execution_context_spec.rb
has_finder-0.1.3 spec/rails/vendor/plugins/rspec/spec/spec/runner/execution_context_spec.rb
picolena-0.0.99 app_generators/picolena/templates/vendor/plugins/rspec/spec/spec/runner/execution_context_spec.rb
picolena-0.1.0 rails_plugins/rspec/spec/spec/runner/execution_context_spec.rb
picolena-0.1.1 rails_plugins/rspec/spec/spec/runner/execution_context_spec.rb
picolena-0.1.2 rails_plugins/rspec/spec/spec/runner/execution_context_spec.rb
picolena-0.1.3 rails_plugins/rspec/spec/spec/runner/execution_context_spec.rb
picolena-0.1.4 rails_plugins/rspec/spec/spec/runner/execution_context_spec.rb
picolena-0.1.5 rails_plugins/rspec/spec/spec/runner/execution_context_spec.rb
rspec-1.0.1 spec/spec/runner/execution_context_spec.rb
rspec-0.9.0 spec/spec/runner/execution_context_spec.rb
rspec-0.9.1 spec/spec/runner/execution_context_spec.rb
rspec-0.9.2 spec/spec/runner/execution_context_spec.rb
rspec-0.9.3 spec/spec/runner/execution_context_spec.rb
rspec-0.9.4 spec/spec/runner/execution_context_spec.rb
rspec-1.0.0 spec/spec/runner/execution_context_spec.rb
rspec-1.0.2 spec/spec/runner/execution_context_spec.rb
rspec-1.0.3 spec/spec/runner/execution_context_spec.rb