Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test with Ruby 3 #1278

Merged
merged 1 commit into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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