summaryrefslogtreecommitdiff
path: root/spec/install/upgrade_spec.rb
blob: d979b976477bf7edadc7662f4dbff02c45f82438 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# frozen_string_literal: true
require "spec_helper"

describe "bundle install for the first time with v1.0" do
  before :each do
    in_app_root

    gemfile <<-G
      source "file://#{gem_repo1}"
      gem "rack"
    G
  end

  it "removes lockfiles in 0.9 YAML format" do
    File.open("Gemfile.lock", "w") {|f| YAML.dump({}, f) }
    bundle :install
    expect(Pathname.new("Gemfile.lock")).not_to read_as(a_string_starting_with("---"))
  end

  it "removes env.rb if it exists" do
    bundled_app.join(".bundle").mkdir
    bundled_app.join(".bundle/environment.rb").open("w") {|f| f.write("raise 'nooo'") }
    bundle :install
    expect(bundled_app.join(".bundle/environment.rb")).not_to exist
  end
end