Sha256: 7186cd8e8a1e8d92bed9baa6636ae7210271c859207d99b5870aa474f34cced5

Contents?: true

Size: 692 Bytes

Versions: 19

Compression:

Stored size: 692 Bytes

Contents

require 'spec_helper'
require 'bundler/definition'

describe Bundler::Definition do
  before do
    allow(Bundler).to receive(:settings){ Bundler::Settings.new(".") }
    allow(Bundler).to receive(:default_gemfile){ Pathname.new("Gemfile") }
  end

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

      it "raises an InstallError with explanation" do
        expect(File).to receive(:open).with("Gemfile.lock", "wb").
          and_raise(Errno::EACCES)
        expect{ subject.lock("Gemfile.lock") }.
          to raise_error(Bundler::InstallError)
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
bundler-1.7.15 spec/bundler/definition_spec.rb
bundler-1.7.14 spec/bundler/definition_spec.rb
bundler-1.7.13 spec/bundler/definition_spec.rb
bundler-1.7.12 spec/bundler/definition_spec.rb
bundler-1.7.11 spec/bundler/definition_spec.rb
bundler-1.7.10 spec/bundler/definition_spec.rb
bundler-1.7.9 spec/bundler/definition_spec.rb
bundler-1.7.8 spec/bundler/definition_spec.rb
bundler-1.7.7 spec/bundler/definition_spec.rb
bundler-1.7.6 spec/bundler/definition_spec.rb
bundler-1.7.5 spec/bundler/definition_spec.rb
bundler-1.7.4 spec/bundler/definition_spec.rb
bundler-1.7.3 spec/bundler/definition_spec.rb
bundler-1.7.2 spec/bundler/definition_spec.rb
bundler-1.7.1 spec/bundler/definition_spec.rb
bundler-1.7.1.pre.3 spec/bundler/definition_spec.rb
bundler-1.7.1.pre.2 spec/bundler/definition_spec.rb
bundler-1.7.1.pre spec/bundler/definition_spec.rb
bundler-1.7.0 spec/bundler/definition_spec.rb