Skip to content

Commit

Permalink
Adjust specs to be deprecation warning-free
Browse files Browse the repository at this point in the history
  • Loading branch information
pirj committed Jul 18, 2021
1 parent aa1c190 commit e36698a
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 11 deletions.
3 changes: 1 addition & 2 deletions spec/integration/bisect_runners_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ def with_runner(&block)
it 'honors `run_all_when_everything_filtered`' do
write_file 'spec/a_spec.rb', "
RSpec.configure do |c|
c.filter_run :focus
c.run_all_when_everything_filtered = true
c.filter_run_when_matching :focus
end
RSpec.describe 'A group' do
Expand Down
4 changes: 2 additions & 2 deletions spec/rspec/core/formatters/profile_formatter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def profile *groups
end)
end

it_should_behave_like "profiles examples"
it_behaves_like "profiles examples"

it "doesn't profile a single example group" do
expect(formatter_output.string).not_to match(/slowest example groups/)
Expand All @@ -72,7 +72,7 @@ def profile *groups
profile group1, group2
end

it_should_behave_like "profiles examples"
it_behaves_like "profiles examples"

it "prints the slowest example groups" do
expect(formatter_output.string).to match(/slowest example groups/)
Expand Down
6 changes: 3 additions & 3 deletions spec/rspec/core/memoized_helpers_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -633,17 +633,17 @@ def hello_message; "Hello from module"; end

describe Object do
context 'with implicit subject' do
it_should_behave_like 'a subject'
it_behaves_like 'a subject'
end

context 'with explicit subject' do
subject { Object.new }
it_should_behave_like 'a subject'
it_behaves_like 'a subject'
end

context 'with a constant subject'do
subject { 123 }
it_should_behave_like 'a subject'
it_behaves_like 'a subject'
end
end
end
Expand Down
1 change: 0 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ def handle_current_dir_change

# runtime options
c.raise_errors_for_deprecations!
c.color = true
c.include CommonHelpers

c.expect_with :rspec do |expectations|
Expand Down
3 changes: 0 additions & 3 deletions spec/support/aruba_support.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ module ArubaLoader
attr_reader :last_cmd_stdout, :last_cmd_stderr, :last_cmd_exit_status

def run_command(cmd)
RSpec.configuration.color = true

temp_stdout = StringIO.new
temp_stderr = StringIO.new

Expand All @@ -51,7 +49,6 @@ def run_command(cmd)
end
ensure
RSpec.reset
RSpec.configuration.color = true

# Ensure it gets cached with a proper value -- if we leave it set to nil,
# and the next spec operates in a different dir, it could get set to an
Expand Down

0 comments on commit e36698a

Please sign in to comment.