Sha256: 65afb2e089fe79a3a68ec5e6f35cac17c7ffee01c127cd2b04db81d26e04141a

Contents?: true

Size: 676 Bytes

Versions: 3

Compression:

Stored size: 676 Bytes

Contents

require File.expand_path('../../fixtures/classes', __FILE__)

ruby_version_is "1.9" do
  describe "Delegator#!=" do
    before :all do
      @base = mock('base')
      @delegator = DelegateSpecs::Delegator.new(@base)
    end

    it "is not delegated when passed self" do
      @base.should_not_receive(:"!=")
      (@delegator != @delegator).should be_false
    end

    it "is delegated when passed the delegated object" do
      @base.should_receive(:"!=").and_return(true)
      (@delegator != @base).should be_true
    end

    it "is delegated in general" do
      @base.should_receive(:"!=").and_return(false)
      (@delegator != 42).should be_false
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rubysl-delegate-2.0.1 spec/delegator/not_equal_spec.rb
rubysl-delegate-1.0.0 spec/delegator/not_equal_spec.rb
rubysl-delegate-2.0.0 spec/delegator/not_equal_spec.rb