Top Level Namespace

Defined Under Namespace

Modules: AgentFIX, FIXMessageCache Classes: String

Instance Method Summary collapse

Instance Method Details

#anticipate_fixObject



22
23
24
25
26
# File 'lib/agent_fix/cucumber.rb', line 22

def anticipate_fix
  sleeping(AgentFIX.cucumber_sleep_seconds).seconds.between_tries.failing_after(AgentFIX.cucumber_retries).tries do
    yield
  end
end


40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/agent_fix/cucumber/report.rb', line 40

def print_results agent
  STDERR.puts "\nMessages for ".yellow + agent.name.to_s.white + ": ".yellow
  
  agent.history(:include_session=>true).each do |msg|
    if msg[:sent]
      STDERR.puts "\tsent >>\t #{msg[:message].to_s.gsub!(/\001/, '|')}".green
    else
      outbound = "\trecv <<\t #{msg[:message].to_s.gsub!(/\001/, '|')}"

      if @message!=nil and msg[:message] == @message
        STDERR.puts outbound.red
      else
        if msg[:index] >= agent.bookmark
          STDERR.puts outbound.blue
        else

          if @message_scope.include? msg[:message]
            STDERR.puts outbound.pink
          else
            STDERR.puts outbound.green
          end
        end
      end
    end
  end
end