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

Add step to check for tag only in scoped messages #29

Open
aswaney opened this issue Apr 13, 2016 · 0 comments
Open

Add step to check for tag only in scoped messages #29

aswaney opened this issue Apr 13, 2016 · 0 comments

Comments

@aswaney
Copy link

aswaney commented Apr 13, 2016

Something similar to:

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant