]> git.openstreetmap.org Git - rails.git/blob - vendor/gems/rspec-1.1.2/spec/spec/mocks/bug_report_7805_spec.rb
Show whether a trace is public or private in the trace list, so that a user can easil...
[rails.git] / vendor / gems / rspec-1.1.2 / spec / spec / mocks / bug_report_7805_spec.rb
1 require File.dirname(__FILE__) + '/../../spec_helper.rb'
2
3 module Bug7805
4   #This is really a duplicate of 8302
5
6   describe "Stubs should correctly restore module methods" do
7     it "1 - stub the open method" do
8       File.stub!(:open).and_return("something")
9       File.open.should == "something"
10     end
11     it "2 - use File.open to create example.txt" do
12       filename = "#{File.dirname(__FILE__)}/example-#{Time.new.to_i}.txt"
13       File.exist?(filename).should be_false
14       file = File.open(filename,'w')
15       file.close
16       File.exist?(filename).should be_true
17       File.delete(filename)
18       File.exist?(filename).should be_false
19     end
20   end
21
22 end