Skip to content
This repository was archived by the owner on Dec 12, 2021. It is now read-only.

Commit 2914db5

Browse files
committed
replacing should == with should eq
1 parent 2fe570d commit 2914db5

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

spec/private_pub/faye_extension_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
@message["ext"]["private_pub_signature"] = "bad"
1313
@message["ext"]["private_pub_timestamp"] = "123"
1414
message = @faye.incoming(@message, lambda { |m| m })
15-
message["error"].should == "Incorrect signature."
15+
message["error"].should eq("Incorrect signature.")
1616
end
1717

1818
it "has no error when the signature matches the subscription" do
@@ -31,15 +31,15 @@
3131
@message["ext"]["private_pub_signature"] = sub[:signature]
3232
@message["ext"]["private_pub_timestamp"] = sub[:timestamp]
3333
message = @faye.incoming(@message, lambda { |m| m })
34-
message["error"].should == "Signature has expired."
34+
message["error"].should eq("Signature has expired.")
3535
end
3636

3737
it "has an error when trying to publish to a custom channel with a bad token" do
3838
PrivatePub.config[:secret_token] = "good"
3939
@message["channel"] = "/custom/channel"
4040
@message["ext"]["private_pub_token"] = "bad"
4141
message = @faye.incoming(@message, lambda { |m| m })
42-
message["error"].should == "Incorrect token."
42+
message["error"].should eq("Incorrect token.")
4343
end
4444

4545
it "raises an exception when attempting to call a custom channel without a secret_token set" do

spec/private_pub_spec.rb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616
it "defaults subscription timestamp to current time in milliseconds" do
1717
time = Time.now
1818
Time.stub!(:now).and_return(time)
19-
PrivatePub.subscription[:timestamp].should == (time.to_f * 1000).round
19+
PrivatePub.subscription[:timestamp].should eq((time.to_f * 1000).round)
2020
end
2121

2222
it "loads a simple configuration file via load_config" do
2323
PrivatePub.load_config("spec/fixtures/private_pub.yml", "production")
24-
PrivatePub.config[:server].should == "http://example.com/faye"
25-
PrivatePub.config[:secret_token].should == "PRODUCTION_SECRET_TOKEN"
26-
PrivatePub.config[:signature_expiration].should == 600
24+
PrivatePub.config[:server].should eq("http://example.com/faye")
25+
PrivatePub.config[:secret_token].should eq("PRODUCTION_SECRET_TOKEN")
26+
PrivatePub.config[:signature_expiration].should eq(600)
2727
end
2828

2929
it "raises an exception if an invalid environment is passed to load_config" do
@@ -35,15 +35,15 @@
3535
it "includes channel, server, and custom time in subscription" do
3636
PrivatePub.config[:server] = "server"
3737
subscription = PrivatePub.subscription(:timestamp => 123, :channel => "hello")
38-
subscription[:timestamp].should == 123
39-
subscription[:channel].should == "hello"
40-
subscription[:server].should == "server"
38+
subscription[:timestamp].should eq(123)
39+
subscription[:channel].should eq("hello")
40+
subscription[:server].should eq("server")
4141
end
4242

4343
it "does a sha1 digest of channel, timestamp, and secret token" do
4444
PrivatePub.config[:secret_token] = "token"
4545
subscription = PrivatePub.subscription(:timestamp => 123, :channel => "channel")
46-
subscription[:signature].should == Digest::SHA1.hexdigest("tokenchannel123")
46+
subscription[:signature].should eq(Digest::SHA1.hexdigest("tokenchannel123"))
4747
end
4848

4949
it "formats a message hash given a channel and a string for eval" do
@@ -74,7 +74,7 @@
7474
PrivatePub.config[:server] = "http://localhost"
7575
message = stub(:to_json => "message_json")
7676
Net::HTTP.should_receive(:post_form).with(URI.parse("http://localhost"), :message => "message_json").and_return(:result)
77-
PrivatePub.publish_message(message).should == :result
77+
PrivatePub.publish_message(message).should eq(:result)
7878
end
7979

8080
it "raises an exception if no server is specified when calling publish_message" do
@@ -86,7 +86,7 @@
8686
it "publish_to passes message to publish_message call" do
8787
PrivatePub.should_receive(:message).with("chan", "foo").and_return("message")
8888
PrivatePub.should_receive(:publish_message).with("message").and_return(:result)
89-
PrivatePub.publish_to("chan", "foo").should == :result
89+
PrivatePub.publish_to("chan", "foo").should eq(:result)
9090
end
9191

9292
it "has a Faye rack app instance" do

0 commit comments

Comments
 (0)