2018-11-02 19:07:56 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
RSpec.describe "bundle version" do
|
|
|
|
context "with -v" do
|
2019-01-04 08:10:58 -05:00
|
|
|
it "outputs the version", :bundler => "< 3" do
|
2018-11-02 19:07:56 -04:00
|
|
|
bundle! "-v"
|
|
|
|
expect(out).to eq("Bundler version #{Bundler::VERSION}")
|
|
|
|
end
|
|
|
|
|
2019-01-04 08:10:58 -05:00
|
|
|
it "outputs the version", :bundler => "3" do
|
2018-11-02 19:07:56 -04:00
|
|
|
bundle! "-v"
|
|
|
|
expect(out).to eq(Bundler::VERSION)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context "with --version" do
|
2019-01-04 08:10:58 -05:00
|
|
|
it "outputs the version", :bundler => "< 3" do
|
2018-11-02 19:07:56 -04:00
|
|
|
bundle! "--version"
|
|
|
|
expect(out).to eq("Bundler version #{Bundler::VERSION}")
|
|
|
|
end
|
|
|
|
|
2019-01-04 08:10:58 -05:00
|
|
|
it "outputs the version", :bundler => "3" do
|
2018-11-02 19:07:56 -04:00
|
|
|
bundle! "--version"
|
|
|
|
expect(out).to eq(Bundler::VERSION)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context "with version" do
|
2019-01-04 08:10:58 -05:00
|
|
|
it "outputs the version with build metadata", :bundler => "< 3" do
|
2018-11-02 19:07:56 -04:00
|
|
|
bundle! "version"
|
|
|
|
expect(out).to match(/\ABundler version #{Regexp.escape(Bundler::VERSION)} \(\d{4}-\d{2}-\d{2} commit [a-fA-F0-9]{7,}\)\z/)
|
|
|
|
end
|
|
|
|
|
2019-01-04 08:10:58 -05:00
|
|
|
it "outputs the version with build metadata", :bundler => "3" do
|
2018-11-02 19:07:56 -04:00
|
|
|
bundle! "version"
|
|
|
|
expect(out).to match(/\A#{Regexp.escape(Bundler::VERSION)} \(\d{4}-\d{2}-\d{2} commit [a-fA-F0-9]{7,}\)\z/)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|