Sha256: 79794b9a2e4a3b04f2434c95e9cf29b89a2d2f212c848219d5d2ee6601f847da
Contents?: true
Size: 671 Bytes
Versions: 4
Compression:
Stored size: 671 Bytes
Contents
require File.dirname(__FILE__) + '/../../spec_helper.rb' module Bug7805 #This is really a duplicate of 8302 context "Stubs should correctly restore module methods" do specify "1 - stub the open method" do File.stub!(:open).and_return("something") File.open.should == "something" end specify "2 - use File.open to create example.txt" do filename = "#{File.dirname(__FILE__)}/example-#{Time.new.to_i}.txt" File.exist?(filename).should be_false file = File.open(filename,'w') file.close File.exist?(filename).should be_true File.delete(filename) File.exist?(filename).should be_false end end end
Version data entries
4 entries across 4 versions & 2 rubygems