Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Commit ddbe258

Browse files
committed
dev: more "should ==" to "should eq"
1 parent a44c83b commit ddbe258

11 files changed

+31
-31
lines changed

spec/autotest/rspec_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,14 @@
8686
let(:spec_file) { "spec/autotest/some_spec.rb" }
8787

8888
it "returns no failures if no failures were given in the output" do
89-
rspec_autotest.consolidate_failures([[]]).should == {}
89+
rspec_autotest.consolidate_failures([[]]).should eq({})
9090
end
9191

9292
it "returns a hash with the spec filename => spec name for each failure or error" do
9393
failures = [ [ "false should be false", spec_file ] ]
94-
rspec_autotest.consolidate_failures(failures).should == {
94+
rspec_autotest.consolidate_failures(failures).should eq({
9595
spec_file => ["false should be false"]
96-
}
96+
})
9797
end
9898

9999
context "when subject file appears before the spec file in the backtrace" do

spec/rspec/core/configuration_spec.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -245,31 +245,31 @@ module RSpec::Core
245245

246246
it "assigns the file and line number as a location filter" do
247247
config.files_or_directories_to_run = "path/to/a_spec.rb:37"
248-
config.filter.should == {:locations => {File.expand_path("path/to/a_spec.rb") => [37]}}
248+
config.filter.should eq({:locations => {File.expand_path("path/to/a_spec.rb") => [37]}})
249249
end
250250

251251
it "assigns multiple files with line numbers as location filters" do
252252
config.files_or_directories_to_run = "path/to/a_spec.rb:37", "other_spec.rb:44"
253-
config.filter.should == {:locations => {File.expand_path("path/to/a_spec.rb") => [37],
254-
File.expand_path("other_spec.rb") => [44]}}
253+
config.filter.should eq({:locations => {File.expand_path("path/to/a_spec.rb") => [37],
254+
File.expand_path("other_spec.rb") => [44]}})
255255
end
256256

257257
it "assigns files with multiple line numbers as location filters" do
258258
config.files_or_directories_to_run = "path/to/a_spec.rb:37", "path/to/a_spec.rb:44"
259-
config.filter.should == {:locations => {File.expand_path("path/to/a_spec.rb") => [37, 44]}}
259+
config.filter.should eq({:locations => {File.expand_path("path/to/a_spec.rb") => [37, 44]}})
260260
end
261261
end
262262

263263
context "with multiple line numbers" do
264264
it "assigns the file and line numbers as a location filter" do
265265
config.files_or_directories_to_run = "path/to/a_spec.rb:1:3:5:7"
266-
config.filter.should == {:locations => {File.expand_path("path/to/a_spec.rb") => [1,3,5,7]}}
266+
config.filter.should eq({:locations => {File.expand_path("path/to/a_spec.rb") => [1,3,5,7]}})
267267
end
268268
end
269269

270270
it "assigns the example name as the filter on description" do
271271
config.full_description = "foo"
272-
config.filter.should == {:full_description => /foo/}
272+
config.filter.should eq({:full_description => /foo/})
273273
end
274274

275275
describe "#default_path" do

spec/rspec/core/deprecations_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
it "returns RSpec" do
1111
RSpec.stub(:warn_deprecation)
12-
Spec.should == RSpec
12+
Spec.should eq RSpec
1313
end
1414

1515
it "doesn't include backward compatibility in const_missing backtrace" do
@@ -32,7 +32,7 @@
3232

3333
it "delegates to example" do
3434
RSpec.stub(:warn_deprecation)
35-
running_example.should == example
35+
running_example.should eq example
3636
end
3737
end
3838
end

spec/rspec/core/example_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def assert(val)
8686

8787
describe '#described_class' do
8888
it "returns the class (if any) of the outermost example group" do
89-
described_class.should == RSpec::Core::Example
89+
described_class.should eq RSpec::Core::Example
9090
end
9191
end
9292

spec/rspec/core/formatters/base_formatter_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
end
7474

7575
it "removes lines from rspec and lines that come before the invocation of the at_exit autorun hook" do
76-
formatter.format_backtrace(backtrace, stub.as_null_object).should == ["./my_spec.rb:5"]
76+
formatter.format_backtrace(backtrace, stub.as_null_object).should eq ["./my_spec.rb:5"]
7777
end
7878
end
7979

spec/rspec/core/formatters/snippet_extractor_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module Core
66
module Formatters
77
describe SnippetExtractor do
88
it "falls back on a default message when it doesn't understand a line" do
9-
RSpec::Core::Formatters::SnippetExtractor.new.snippet_for("blech").should == ["# Couldn't get snippet for blech", 1]
9+
RSpec::Core::Formatters::SnippetExtractor.new.snippet_for("blech").should eq(["# Couldn't get snippet for blech", 1])
1010
end
1111

1212
it "falls back on a default message when it doesn't find the file" do

spec/rspec/core/metadata_spec.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ module Core
130130
it "passes the metadata hash as the second argument if a given proc expects 2 args" do
131131
passed_metadata = nil
132132
example_metadata.apply_filter(:if, lambda { |v, m| passed_metadata = m })
133-
passed_metadata.should == example_metadata
133+
passed_metadata.should eq example_metadata
134134
end
135135
end
136136

@@ -148,15 +148,15 @@ module Core
148148
end
149149

150150
it "creates an empty execution result" do
151-
mfe[:execution_result].should == {}
151+
mfe[:execution_result].should eq({})
152152
end
153153

154154
it "extracts file path from caller" do
155-
mfe[:file_path].should == __FILE__
155+
mfe[:file_path].should eq __FILE__
156156
end
157157

158158
it "extracts line number from caller" do
159-
mfe[:line_number].should == line_number
159+
mfe[:line_number].should eq line_number
160160
end
161161

162162
it "extracts location from caller" do
@@ -311,27 +311,27 @@ module Core
311311
"./lib/rspec/core/foo.rb",
312312
"#{__FILE__}:#{__LINE__}"
313313
])
314-
m[:example_group][:file_path].should == __FILE__
314+
m[:example_group][:file_path].should eq __FILE__
315315
end
316316
end
317317

318318
describe ":line_number" do
319319
it "finds the line number with the first non-rspec lib file in the backtrace" do
320320
m = Metadata.new
321321
m.process({})
322-
m[:example_group][:line_number].should == __LINE__ - 1
322+
m[:example_group][:line_number].should eq(__LINE__ - 1)
323323
end
324324

325325
it "finds the line number with the first spec file with drive letter" do
326326
m = Metadata.new
327327
m.process(:caller => [ "C:/path/to/file_spec.rb:#{__LINE__}" ])
328-
m[:example_group][:line_number].should == __LINE__ - 1
328+
m[:example_group][:line_number].should eq(__LINE__ - 1)
329329
end
330330

331331
it "uses the number after the first : for ruby 1.9" do
332332
m = Metadata.new
333333
m.process(:caller => [ "#{__FILE__}:#{__LINE__}:999" ])
334-
m[:example_group][:line_number].should == __LINE__ - 1
334+
m[:example_group][:line_number].should eq(__LINE__ - 1)
335335
end
336336
end
337337

@@ -343,7 +343,7 @@ module Core
343343
child = Metadata.new(parent)
344344
child.process()
345345

346-
child[:example_group][:example_group].should == parent[:example_group]
346+
child[:example_group][:example_group].should eq parent[:example_group]
347347
end
348348
end
349349
end

spec/rspec/core/reporter_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ module RSpec::Core
4444

4545
group.run(Reporter.new(formatter))
4646

47-
order.should == [
47+
order.should eq [
4848
"Started: root",
4949
"Started: context 1",
5050
"Finished: context 1",

spec/rspec/core/shared_example_group_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def self.foo; end
119119
end
120120
group.run
121121

122-
passed_params.should == { :param1 => :value1, :param2 => :value2 }
122+
passed_params.should eq({ :param1 => :value1, :param2 => :value2 })
123123
end
124124

125125
it "adds shared instance methods to nested group" do

spec/rspec/core/subject_spec.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ module RSpec::Core
88
describe "implicit subject" do
99
describe "with a class" do
1010
it "returns an instance of the class" do
11-
ExampleGroup.describe(Array).subject.call.should == []
11+
ExampleGroup.describe(Array).subject.call.should eq []
1212
end
1313
end
1414

1515
describe "with a Module" do
1616
it "returns the Module" do
17-
ExampleGroup.describe(Enumerable).subject.call.should == Enumerable
17+
ExampleGroup.describe(Enumerable).subject.call.should eq Enumerable
1818
end
1919
end
2020

@@ -56,7 +56,7 @@ module RSpec::Core
5656
it "replaces the implicit subject in that group" do
5757
group = ExampleGroup.describe(Array)
5858
group.subject { [1,2,3] }
59-
group.subject.call.should == [1,2,3]
59+
group.subject.call.should eq [1,2,3]
6060
end
6161
end
6262

@@ -69,13 +69,13 @@ module RSpec::Core
6969

7070
it "is available in a nested group (subclass)" do
7171
nested_group = group.describe("I'm nested!") { }
72-
nested_group.subject.call.should == [4,5,6]
72+
nested_group.subject.call.should eq [4,5,6]
7373
end
7474

7575
it "is available in a doubly nested group (subclass)" do
7676
nested_group = group.describe("Nesting level 1") { }
7777
doubly_nested_group = nested_group.describe("Nesting level 2") { }
78-
doubly_nested_group.subject.call.should == [4,5,6]
78+
doubly_nested_group.subject.call.should eq [4,5,6]
7979
end
8080
end
8181
end

spec/rspec/core_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
it "yields the current configuration" do
2323
RSpec.configure do |config|
24-
config.should == RSpec::configuration
24+
config.should eq RSpec::configuration
2525
end
2626
end
2727

0 commit comments

Comments
 (0)