Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added step to check for a tag in multiple messages. Bumped version #30

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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