Sha256: ded8fe28d10ed54ba0ecc4b8ea2f788a7a4ab948ff8f14aa04aa18eee2ffa96b

Contents?: true

Size: 606 Bytes

Versions: 8

Compression:

Stored size: 606 Bytes

Contents

require 'spec_helper'
require 'bundler/definition'

describe Bundler::Definition do
  before do
    Bundler.stub(:settings){ Bundler::Settings.new(".") }
  end

  describe "#lock" do
    context "when it's not possible to write to the file" do
      subject{ Bundler::Definition.new(nil, [], [], []) }

      before do
        File.should_receive(:open).with("Gemfile.lock", "wb").
          and_raise(Errno::EACCES)
      end

      it "raises an InstallError with explanation" do
        expect{ subject.lock("Gemfile.lock") }.
          to raise_error(Bundler::InstallError)
      end
    end
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
bundler-1.2.5 spec/bundler/definition_spec.rb
bundler-1.2.4 spec/bundler/definition_spec.rb
bundler-1.2.3 spec/bundler/definition_spec.rb
bundler-1.2.2 spec/bundler/definition_spec.rb
bundler-1.2.1 spec/bundler/definition_spec.rb
bundler-1.2.0 spec/bundler/definition_spec.rb
bundler-1.2.0.rc.2 spec/bundler/definition_spec.rb
bundler-1.2.0.rc spec/bundler/definition_spec.rb