Skip to content

Commit b6df0b8

Browse files
author
Chris Busbey
committed
update to rspec3
1 parent 2e1e52b commit b6df0b8

File tree

6 files changed

+32
-28
lines changed

6 files changed

+32
-28
lines changed

Gemfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ gem "quickfix-jruby", "~>1.6.0"
44
gem "anticipate"
55
gem "cucumber", "~> 1.3"
66
gem "fix_spec", "~> 0.4.1"
7+
gem "rspec", "~> 3.0"
78

89
group :development do
910
gem "jeweler", "~> 1.8.8"
10-
gem "rspec", "~> 2.14"
1111
gem "rake", "~> 10.1"
1212
end

Gemfile.lock

+15-10
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ GEM
1212
multi_test (>= 0.0.2)
1313
cuke_mem (0.1.1)
1414
cucumber (~> 1.3)
15-
diff-lcs (1.2.4)
15+
diff-lcs (1.2.5)
1616
faraday (0.8.8)
1717
multipart-post (~> 1.2.0)
1818
fix_spec (0.4.1)
@@ -64,14 +64,19 @@ GEM
6464
rake (10.1.0)
6565
rdoc (4.0.1)
6666
json (~> 1.4)
67-
rspec (2.14.1)
68-
rspec-core (~> 2.14.0)
69-
rspec-expectations (~> 2.14.0)
70-
rspec-mocks (~> 2.14.0)
71-
rspec-core (2.14.5)
72-
rspec-expectations (2.14.2)
73-
diff-lcs (>= 1.1.3, < 2.0)
74-
rspec-mocks (2.14.3)
67+
rspec (3.3.0)
68+
rspec-core (~> 3.3.0)
69+
rspec-expectations (~> 3.3.0)
70+
rspec-mocks (~> 3.3.0)
71+
rspec-core (3.3.1)
72+
rspec-support (~> 3.3.0)
73+
rspec-expectations (3.3.0)
74+
diff-lcs (>= 1.2.0, < 2.0)
75+
rspec-support (~> 3.3.0)
76+
rspec-mocks (3.3.1)
77+
diff-lcs (>= 1.2.0, < 2.0)
78+
rspec-support (~> 3.3.0)
79+
rspec-support (3.3.0)
7580

7681
PLATFORMS
7782
java
@@ -83,4 +88,4 @@ DEPENDENCIES
8388
jeweler (~> 1.8.8)
8489
quickfix-jruby (~> 1.6.0)
8590
rake (~> 10.1)
86-
rspec (~> 2.14)
91+
rspec (~> 3.0)

features/step_definitions/steps.rb

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88

99
Given(/^my agents are logged on$/) do
1010
sleeping(AgentFIX.cucumber_sleep_seconds).seconds.between_tries.failing_after(AgentFIX.cucumber_retries).tries do
11-
AgentFIX.agents_hash[:my_acceptor].loggedOn?.should be_true
12-
AgentFIX.agents_hash[:my_initiator].loggedOn?.should be_true
13-
AgentFIX.agents_hash[:my_fix50_acceptor].loggedOn?.should be_true
14-
AgentFIX.agents_hash[:my_fix50_initiator].loggedOn?.should be_true
11+
expect(AgentFIX.agents_hash[:my_acceptor].loggedOn?).to eq(true)
12+
expect(AgentFIX.agents_hash[:my_initiator].loggedOn?).to eq(true)
13+
expect(AgentFIX.agents_hash[:my_fix50_acceptor].loggedOn?).to eq(true)
14+
expect(AgentFIX.agents_hash[:my_fix50_initiator].loggedOn?).to eq(true)
1515
end
1616
end
1717

@@ -28,5 +28,5 @@
2828

2929
reqID = quickfix.field.TestReqID.new
3030
@message.getField(reqID)
31-
reqID.getValue.should ==(value)
31+
expect(reqID.getValue).to eq(value)
3232
end

lib/agent_fix/cucumber.rb

+7-8
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ def anticipate_fix
4949
messages = @agent.messages_received :since=>@agent.bookmark
5050

5151
if exact
52-
(messages.length).should be == count, "Expected exactly #{count} messages, but got #{messages.length}"
52+
expect(messages.length).to eq(count), "Expected exactly #{count} messages, but got #{messages.length}"
5353
else
54-
(messages.length).should be >= count, "Expected #{count} messages, but got #{messages.length}"
54+
expect(messages.length).to be >= count, "Expected #{count} messages, but got #{messages.length}"
5555
end
5656

5757
scope=messages.slice(0, count)
@@ -62,7 +62,7 @@ def anticipate_fix
6262
end
6363

6464
scope.each do |msg|
65-
msg[:message].header.get_string(35).should == type
65+
expect(msg[:message].header.get_string(35)).to eq(type)
6666
end
6767
end
6868
end
@@ -96,8 +96,8 @@ def anticipate_fix
9696
When(/^I inspect the (\d+)(?:.*?)(?: FIX| fix)? message$/) do |index|
9797
index = index.to_i-1
9898

99-
@message_scope.should_not be_nil, "No message scope defined"
100-
@message_scope.length.should be >index, "There are only #{@message_scope.length} messages in the scope"
99+
expect(@message_scope).not_to be_nil, "No message scope defined"
100+
expect(@message_scope.length).to be >index, "There are only #{@message_scope.length} messages in the scope"
101101
@message = @message_scope[index]
102102
end
103103

@@ -116,7 +116,7 @@ def anticipate_fix
116116
end
117117

118118
Then(/^the(?: FIX|fix)? messages should include(?: a message with)? the following:$/) do |table|
119-
@message_scope.should_not be_nil, "No message scope defined"
119+
expect(@message_scope).not_to be_nil, "No message scope defined"
120120

121121
table_raw =""
122122
table.raw.each do |path, val|
@@ -141,6 +141,5 @@ def anticipate_fix
141141
index += 1
142142
end
143143

144-
found.should be_true, "Message not included in FIX messages\n #{error_accum}"
145-
144+
expect(found).to be(true), "Message not included in FIX messages\n #{error_accum}"
146145
end

spec/agent_fix/configuration_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
describe AgentFIX::Configuration do
44
it "inspects just app messages by default" do
5-
AgentFIX.include_session_level?.should be_false
5+
expect(AgentFIX.include_session_level?).to be(false)
66
end
77

88
it "can inspect both app and session level messages" do
99
AgentFIX.include_session_level = true
10-
AgentFIX.include_session_level?.should be_true
10+
expect(AgentFIX.include_session_level?).to be(true)
1111
end
1212
end

spec/agent_fix/message_cache_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
cache.add_message "3"
99

1010
msgs = cache.messages
11-
msgs.should == ["1","2","3"]
11+
expect(msgs).to eq(["1","2","3"])
1212

1313
cache.clear!
14-
msgs.should == ["1","2","3"]
14+
expect(msgs).to eq(["1","2","3"])
1515
end
1616
end

0 commit comments

Comments
 (0)