From 8e640ab3c04b3b654d2add0839223654ae1d1aac Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Fri, 16 Feb 2024 22:02:39 +0000 Subject: [PATCH] Merge pull request #1569 from p-linnane/fix-various-typos various: fix miscellaneous typos --- lib/rspec/mocks/configuration.rb | 2 +- lib/rspec/mocks/message_expectation.rb | 2 +- spec/rspec/mocks/once_counts_spec.rb | 2 +- spec/rspec/mocks/partial_double_spec.rb | 8 ++++---- spec/rspec/mocks/stubbed_message_expectations_spec.rb | 4 ++-- spec/rspec/mocks/twice_counts_spec.rb | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/rspec/mocks/configuration.rb b/lib/rspec/mocks/configuration.rb index 5962215f8..8496bdcc0 100644 --- a/lib/rspec/mocks/configuration.rb +++ b/lib/rspec/mocks/configuration.rb @@ -156,7 +156,7 @@ def verify_partial_doubles? end # @private - # Used to track wether we are temporarily suppressing verifying partial + # Used to track whether we are temporarily suppressing verifying partial # doubles with `without_partial_double_verification { ... }` attr_accessor :temporarily_suppress_partial_double_verification diff --git a/lib/rspec/mocks/message_expectation.rb b/lib/rspec/mocks/message_expectation.rb index 110e1cb07..8b21ae0be 100644 --- a/lib/rspec/mocks/message_expectation.rb +++ b/lib/rspec/mocks/message_expectation.rb @@ -101,7 +101,7 @@ def and_return(first_value, *values) # # allow(api).to receive(:get_foo).and_invoke(-> { raise ApiTimeout }, -> { raise ApiTimeout }, -> { :a_foo }) # api.get_foo # => raises ApiTimeout - # api.get_foo # => rasies ApiTimeout + # api.get_foo # => raises ApiTimeout # api.get_foo # => :a_foo # api.get_foo # => :a_foo # api.get_foo # => :a_foo diff --git a/spec/rspec/mocks/once_counts_spec.rb b/spec/rspec/mocks/once_counts_spec.rb index e65231fc7..81e1f3cb6 100644 --- a/spec/rspec/mocks/once_counts_spec.rb +++ b/spec/rspec/mocks/once_counts_spec.rb @@ -60,7 +60,7 @@ module Mocks # call with these args), but currently it fails with a confusing # message on verification, and ultimately we care more about # what the message is than when it is raised. Still, it would be - # preferrable for the error to be triggered on the first line, + # preferable for the error to be triggered on the first line, # so it'd be good to update this spec to enforce that once we # get the failure message right. @double.do_something(:args, 1) diff --git a/spec/rspec/mocks/partial_double_spec.rb b/spec/rspec/mocks/partial_double_spec.rb index 719041bdb..3272dbdf7 100644 --- a/spec/rspec/mocks/partial_double_spec.rb +++ b/spec/rspec/mocks/partial_double_spec.rb @@ -382,7 +382,7 @@ def defined_private_method expect(object.send(:defined_private_method)).to eq("works") end - it 'can be temporarily supressed' do + it 'can be temporarily suppressed' do without_partial_double_verification do expect(object).to receive(:fictitious_method) { 'works' } expect_any_instance_of(klass).to receive(:other_fictitious_method) { 'works' } @@ -395,7 +395,7 @@ def defined_private_method }.to raise_error RSpec::Mocks::MockExpectationError end - it 'can be temporarily supressed and nested' do + it 'can be temporarily suppressed and nested' do without_partial_double_verification do without_partial_double_verification do expect(object).to receive(:fictitious_method) { 'works' } @@ -410,7 +410,7 @@ def defined_private_method }.to raise_error RSpec::Mocks::MockExpectationError end - specify 'temporarily supressing partial doubles does not affect normal verifying doubles' do + specify 'temporarily suppressing partial doubles does not affect normal verifying doubles' do without_partial_double_verification do expect { instance_double(Class.new, :fictitious_method => 'works') @@ -471,7 +471,7 @@ def defined_private_method ) end - it 'can be temporarily supressed' do + it 'can be temporarily suppressed' do without_partial_double_verification do expect(subclass).to receive(:fictitious_method) { 'works' } end diff --git a/spec/rspec/mocks/stubbed_message_expectations_spec.rb b/spec/rspec/mocks/stubbed_message_expectations_spec.rb index 6e55adea8..c7e4514ad 100644 --- a/spec/rspec/mocks/stubbed_message_expectations_spec.rb +++ b/spec/rspec/mocks/stubbed_message_expectations_spec.rb @@ -1,4 +1,4 @@ -RSpec.describe "expection set on previously stubbed method" do +RSpec.describe "expectation set on previously stubbed method" do it "fails if message is not received after expectation is set" do dbl = double(:msg => nil) dbl.msg @@ -40,7 +40,7 @@ verify dbl end - it 'indicates the site of expectation in the stacktrace when outputing arguments of similar calls' do + it 'indicates the site of expectation in the stacktrace when outputting arguments of similar calls' do dbl = double('double', :foo => true) expect(dbl).to receive(:foo).with('first'); line = __LINE__ diff --git a/spec/rspec/mocks/twice_counts_spec.rb b/spec/rspec/mocks/twice_counts_spec.rb index 8cb75ce14..48d07c072 100644 --- a/spec/rspec/mocks/twice_counts_spec.rb +++ b/spec/rspec/mocks/twice_counts_spec.rb @@ -76,7 +76,7 @@ module Mocks # call with these args), but currently it fails with a confusing # message on verification, and ultimately we care more about # what the message is than when it is raised. Still, it would be - # preferrable for the error to be triggered on the first line, + # preferable for the error to be triggered on the first line, # so it'd be good to update this spec to enforce that once we # get the failure message right. @double.do_something(:args, 1)