Skip to content
Browse files

Fix tests

  • Loading branch information...
1 parent 35b7d4b commit b9f91ff881d0b0b7d80a58f13f30976367a8f553 @gdb gdb committed Sep 27, 2012
Showing with 6 additions and 4 deletions.
  1. +6 −4 test/unit/einhorn/command/interface.rb
View
10 test/unit/einhorn/command/interface.rb
@@ -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
@@ -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
@@ -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.
Something went wrong with that request. Please try again.