Sha256: 9e0683c29bc4b363a46ce9f3b3e590b02c311a88d9307f10f9d10e129ae51134
Contents?: true
Size: 628 Bytes
Versions: 44
Compression:
Stored size: 628 Bytes
Contents
require 'spec_helper' module Bug7805 #This is really a duplicate of 8302 describe "Stubs should correctly restore module methods" do it "1 - stub the open method" do File.stub!(:open).and_return("something") File.open.should == "something" end it "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
44 entries across 44 versions & 12 rubygems