Sha256: 62acde278a27627cdce9ecc8fb8143c8eac834f97e3d05b81ad8324c01f8afd0

Contents?: true

Size: 596 Bytes

Versions: 16

Compression:

Stored size: 596 Bytes

Contents

require 'spec_helper'
require 'bundler/definition'

describe Bundler::Definition do
  before do
    allow(Bundler).to receive(: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, [], [], []) }

      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

16 entries across 16 versions & 2 rubygems

Version Path
bundler-1.6.9 spec/bundler/definition_spec.rb
bundler-1.6.8 spec/bundler/definition_spec.rb
bundler-1.6.7 spec/bundler/definition_spec.rb
bundler-1.6.6 spec/bundler/definition_spec.rb
bundler-1.6.5 spec/bundler/definition_spec.rb
bundler-1.6.4 spec/bundler/definition_spec.rb
bundler-prehistoric-1.6.2.2 spec/bundler/definition_spec.rb
bundler-1.6.3 spec/bundler/definition_spec.rb
bundler-prehistoric-1.6.2.1 spec/bundler/definition_spec.rb
bundler-prehistoric-1.6.2 spec/bundler/definition_spec.rb
bundler-1.6.2 spec/bundler/definition_spec.rb
bundler-1.6.1 spec/bundler/definition_spec.rb
bundler-1.6.0 spec/bundler/definition_spec.rb
bundler-1.6.0.rc2 spec/bundler/definition_spec.rb
bundler-1.6.0.rc spec/bundler/definition_spec.rb
bundler-1.6.0.pre.2 spec/bundler/definition_spec.rb