Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gdb committed Sep 27, 2012
1 parent 35b7d4b commit b9f91ff
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions test/unit/einhorn/command/interface.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@ class InterfaceTest < Test::Unit::TestCase
should "call that command" do
conn = stub(:log_debug => nil)
conn.expects(:write).once.with do |message|
parsed = JSON.parse(message)
# Remove trailing newline
message = message[0...-1]
parsed = YAML.load(URI.unescape(message))
parsed['message'] =~ /Welcome gdb/
end
request = {
'command' => 'ehlo',
'user' => 'gdb'
}
Interface.process_command(conn, JSON.generate(request))
Interface.process_command(conn, YAML.dump(request))
end
end

Expand All @@ -27,7 +29,7 @@ class InterfaceTest < Test::Unit::TestCase
request = {
'command' => 'made-up',
}
Interface.process_command(conn, JSON.generate(request))
Interface.process_command(conn, YAML.dump(request))
end
end

Expand All @@ -41,7 +43,7 @@ class InterfaceTest < Test::Unit::TestCase
'pid' => 1234
}
Einhorn::Command.expects(:register_manual_ack).once.with(1234)
Interface.process_command(conn, JSON.generate(request))
Interface.process_command(conn, YAML.dump(request))
end
end
end

0 comments on commit b9f91ff

Please sign in to comment.