Sha256: a6b3ddd9ce6579be0a052ba6c894d0212e0ff0397e9edc9a3c9e47ab3e0b5f5a

Contents?: true

Size: 779 Bytes

Versions: 3

Compression:

Stored size: 779 Bytes

Contents

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

describe TypeSafe, ".must_be_kind_of" do
  it "should recognize ClassA as kind of Object" do
    lambda{ClassA.must_be_kind_of(Object)}.should_not raise_error(TypeError)
  end
  it "should recognize ClassB as kind of ClassA" do
    lambda{ClassB.must_be_kind_of(ClassA)}.should_not raise_error(TypeError)
  end
  it "should not recognize ClassC as kind of ClassA" do
    lambda{ClassC.must_be_kind_of(ClassA)}.should raise_error(TypeError)
  end
  it "should not recognize ClassC as kind of ModA" do
    lambda{ClassC.must_be_kind_of(ModA)}.should raise_error(TypeError)
  end
  it "should recognize ClassD as kind of ModA" do
    lambda{ClassD.must_be_kind_of(ModA)}.should_not raise_error(TypeError)
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
tsalzer-typesafe-0.0.1 spec/typesafe_class_spec.rb
tsalzer-typesafe-0.0.2 spec/typesafe_class_spec.rb
typesafe-0.0.2 spec/typesafe_class_spec.rb