Sha256: eab3b2a0108e51e9301e8132e0a5d3888ee3f30e50bc9c358c53dc34afada7ef

Contents?: true

Size: 790 Bytes

Versions: 16

Compression:

Stored size: 790 Bytes

Contents

require File.dirname(__FILE__) + '/../spec_helper'
require 'mspec/runner/shared'

describe Object, "#it_behaves_like" do
  before :each do
    @recv = Object.new
    def @recv.before(what)
      yield
    end
    @recv.stub!(:it_should_behave_like)
  end

  it "creates @method set to the name of the aliased method" do
    @recv.it_behaves_like "something", :some_method
    @recv.instance_variable_get(:@method).should == :some_method
  end

  it "creates @object if the passed object is not nil" do
    @recv.it_behaves_like "something", :some_method, :some_object
    @recv.instance_variable_get(:@object).should == :some_object
  end

  it "sends :it_should_behave_like" do
    @recv.should_receive(:it_should_behave_like)
    @recv.it_behaves_like "something", :some_method
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
mspec-1.5.14 spec/runner/shared_spec.rb
mspec-1.5.13 spec/runner/shared_spec.rb
mspec-1.5.2 spec/runner/shared_spec.rb
mspec-1.4.0 spec/runner/shared_spec.rb
mspec-1.5.3 spec/runner/shared_spec.rb
mspec-1.5.0 spec/runner/shared_spec.rb
mspec-1.5.1 spec/runner/shared_spec.rb
mspec-1.5.10 spec/runner/shared_spec.rb
mspec-1.5.11 spec/runner/shared_spec.rb
mspec-1.5.12 spec/runner/shared_spec.rb
mspec-1.5.4 spec/runner/shared_spec.rb
mspec-1.5.8 spec/runner/shared_spec.rb
mspec-1.5.6 spec/runner/shared_spec.rb
mspec-1.5.5 spec/runner/shared_spec.rb
mspec-1.5.7 spec/runner/shared_spec.rb
mspec-1.5.9 spec/runner/shared_spec.rb