changelog shortlog tags changeset manifest revisions annotate raw

vendor/plugins/rspec/spec/spec/mocks/bug_report_7805_spec.rb

changeset 15: 64acf98d15f4
author: moriq@moriq.com
date: Mon Mar 10 10:12:58 2008 +0900 (16 years ago)
permissions: -rw-r--r--
description: add plugins rspec
1require File.dirname(__FILE__) + '/../../spec_helper.rb'
2
3module 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
22end