Skip to content

Commit

Permalink
Test with Ruby 3
Browse files Browse the repository at this point in the history
- Add `.ruby-version` file (which is also used by `ruby/setup-ruby`)
- Add `.rubocop.yml` symlink so that `brew style` and `rubocop` (e.g.
  run by VSCode) are consistent
- Don't `bundle install` with an ancient Bundler
- Fix `bundle_utils_spec` without changing behaviour
  • Loading branch information
MikeMcQuaid committed Jan 9, 2024
1 parent aeb6ac0 commit 5f907c3
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
1 change: 0 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ jobs:
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.6'
bundler-cache: true

- name: Run RSpec tests
Expand Down
1 change: 1 addition & 0 deletions .rubocop.yml
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.1.4
3 changes: 0 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,3 @@ DEPENDENCIES
rspec
simplecov
simplecov-cobertura

BUNDLED WITH
1.17.3
14 changes: 8 additions & 6 deletions spec/bundle_utils_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,18 @@
end

context "when the system call fails" do
before do
allow_any_instance_of(Process::Status).to receive(:success?).and_return(false)
end

it "emits all stdout output even if verbose is false" do
expect { described_class.system "echo", "foo", verbose: false }.to output("foo\n").to_stdout_from_any_process
expect do
described_class.system "/bin/bash", "-c", "echo foo && false",
verbose: false
end.to output("foo\n").to_stdout_from_any_process
end

it "emits all stdout output only once if verbose is true" do
expect { described_class.system "echo", "foo", verbose: true }.to output("foo\n").to_stdout_from_any_process
expect do
described_class.system "/bin/bash", "-c", "echo foo && true",
verbose: true
end.to output("foo\n").to_stdout_from_any_process
end
end

Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def linux?
RSpec::Support::ObjectFormatter.default_instance.max_formatted_output_length = nil

config.around do |example|
Bundler.with_clean_env { example.run }
Bundler.with_original_env { example.run }
end

config.before(:each, :needs_linux) do
Expand Down

0 comments on commit 5f907c3

Please sign in to comment.