Sha256: 9a9a5e84d12f3e22aac1459fe94f19445dc7a6847551afd2888b2762b60e5cbc
Contents?: true
Size: 460 Bytes
Versions: 12
Compression:
Stored size: 460 Bytes
Contents
require "spec_helper" describe "using" do let(:item) { double("item", dispose: true) } it "disposes the item" do using(item) { } item.should have_received(:dispose) end it "performs the action" do ran = false using(item) do ran = true end ran.should be_true end it "always cleans up the resource" do begin using(item) { raise "heck" } rescue end item.should have_received(:dispose) end end
Version data entries
12 entries across 12 versions & 1 rubygems