Skip to content

Commit

Permalink
Added step to check for a tag in multiple messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
aswaney committed Apr 13, 2016
1 parent 1e4fad8 commit 8c25fcd
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
jruby-1.7.24
23 changes: 23 additions & 0 deletions lib/agent_fix/cucumber.rb
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,26 @@ def anticipate_fix

expect(found).to be(true), "Message not included in FIX messages\n #{error_accum}"
end

Then(/^the (?:fix|FIX) messages should include a message with(?: the tag)? "(.*)"$/) do |path|
expect(@message_scope).not_to be_nil, "No message scope defined"

found = false
error_accum = ""
index = 1
@message_scope.each do |m|
@message = m
begin
steps %Q{
When I inspect the #{index}th FIX message
And the FIX message should have "#{path}"
}
found = true
rescue Exception => e
error_accum << "\n#{m.to_s.gsub!(/\001/, '|')}\n #{e}"
end
index += 1
end

expect(found).to be(true), "Tag not included in FIX messages\n #{error_accum}"
end

0 comments on commit 8c25fcd

Please sign in to comment.