Skip to content

Instantly share code, notes, and snippets.

@toctan
Created September 13, 2013 07:50
Show Gist options
  • Save toctan/6547840 to your computer and use it in GitHub Desktop.
Save toctan/6547840 to your computer and use it in GitHub Desktop.
require 'delegate'
class Bar < SimpleDelegator
def initialize(obj)
super(obj)
end
end
class Foo
end
require 'minitest/autorun'
describe Bar do
subject { Bar.new(Foo.new) }
it "assert kind of Bar" do
assert_kind_of(Bar, subject) # => true
end
it "must be kind of Bar" do
subject.must_be_kind_of Bar # => false
end
it "assert instance of Bar" do
assert_instance_of(Bar, subject) # => true
end
it "must be instance of Bar" do
subject.must_be_instance_of Bar # => false
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment