Sha256: cbc44f1eaeb9ad3b3188fb24acbbb3c5bec00e089e4aa6c0c2852cca956bf08c
Contents?: true
Size: 741 Bytes
Versions: 4
Compression:
Stored size: 741 Bytes
Contents
require "spec_helper" describe RSpec::Rails::AssertionDelegator do it "provides a module that delegates assertion methods to an isolated class" do klass = Class.new { include RSpec::Rails::AssertionDelegator.new(Test::Unit::Assertions) } expect(klass.new).to respond_to(:assert) end it "delegates back to the including instance for methods the assertion module requires" do assertions = Module.new { def has_thing?(thing) self.things.include?(thing) end } klass = Class.new { include RSpec::Rails::AssertionDelegator.new(assertions) def things [:a] end } expect(klass.new).to have_thing(:a) expect(klass.new).not_to have_thing(:b) end end
Version data entries
4 entries across 4 versions & 2 rubygems