Sha256: d17cd38a3e23c62bb36dcacf1433edf30a5173ce7f68450a9c32a4ebd678e53a

Contents?: true

Size: 663 Bytes

Versions: 104

Compression:

Stored size: 663 Bytes

Contents

require File.dirname(__FILE__) + '/../../spec_helper.rb'

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

104 entries across 104 versions & 15 rubygems

Version Path
mack-0.8.2 lib/gems/rspec-1.1.11/spec/spec/mocks/bug_report_7805_spec.rb
picolena-0.0.99 app_generators/picolena/templates/vendor/plugins/rspec/spec/spec/mocks/bug_report_7805_spec.rb
picolena-0.1.0 rails_plugins/rspec/spec/spec/mocks/bug_report_7805_spec.rb
picolena-0.1.1 rails_plugins/rspec/spec/spec/mocks/bug_report_7805_spec.rb
picolena-0.1.3 rails_plugins/rspec/spec/spec/mocks/bug_report_7805_spec.rb
picolena-0.1.2 rails_plugins/rspec/spec/spec/mocks/bug_report_7805_spec.rb
picolena-0.1.4 rails_plugins/rspec/spec/spec/mocks/bug_report_7805_spec.rb
picolena-0.1.6 rails_plugins/rspec/spec/spec/mocks/bug_report_7805_spec.rb
picolena-0.1.5 rails_plugins/rspec/spec/spec/mocks/bug_report_7805_spec.rb
picolena-0.1.7 rails_plugins/rspec/spec/spec/mocks/bug_report_7805_spec.rb
picolena-0.1.8 rails_plugins/rspec/spec/spec/mocks/bug_report_7805_spec.rb
pictrails-0.5.0 vendor/plugins/rspec/spec/spec/mocks/bug_report_7805_spec.rb
radiant-0.6.5.1 vendor/plugins/rspec/spec/spec/mocks/bug_report_7805_spec.rb
radiant-0.6.5 vendor/plugins/rspec/spec/spec/mocks/bug_report_7805_spec.rb
radiant-0.6.6 vendor/plugins/rspec/spec/spec/mocks/bug_report_7805_spec.rb
radiant-0.6.7 vendor/plugins/rspec/spec/spec/mocks/bug_report_7805_spec.rb
radiant-0.6.9 vendor/plugins/rspec/spec/spec/mocks/bug_report_7805_spec.rb
radiant-0.6.8 vendor/plugins/rspec/spec/spec/mocks/bug_report_7805_spec.rb
rspec-0.0.10 spec/spec/mocks/bug_report_7805_spec.rb
rspec-1.0.5 spec/spec/mocks/bug_report_7805_spec.rb