Sha256: c44ec0e6f75eab3f90d3d2e8e260cd08cd656cd91f31a8b59150f6346864f5ce

Contents?: true

Size: 829 Bytes

Versions: 4

Compression:

Stored size: 829 Bytes

Contents

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

context "should_be_an_instance_of" do
  specify "should fail when target is not specified class (OLD STYLE)" do
    lambda do
      5.should_be_an_instance_of(Integer)
    end.should_fail_with "expected instance_of?(Integer) to return true, got false"
  end

  specify "should pass when target is specified class (OLD STYLE)" do
    lambda do
      5.should_be_an_instance_of(Fixnum)
    end.should_pass
  end

begin
  specify "should fail when target is not specified class" do
    lambda do
      5.should be_instance_of(Integer)
    end.should_fail_with "expected instance_of?(Integer) to return true, got false"
  end

  specify "should pass when target is specified class" do
    lambda do
      5.should be_instance_of(Fixnum)
    end.should_pass
  end
end

end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
riess-0.0.8 vendor/rspec-0.8.2/spec/spec/expectations/should/should_be_an_instance_of_spec.rb
rspec-0.8.0 spec/spec/expectations/should/should_be_an_instance_of_spec.rb
rspec-0.8.1 spec/spec/expectations/should/should_be_an_instance_of_spec.rb
rspec-0.8.2 spec/spec/expectations/should/should_be_an_instance_of_spec.rb