Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add test to check JsonMessage#decode with bad json

Change-Id: I8f858c291564489dc6ab5f5d87768a66c6b64d32
  • Loading branch information...
commit ba11bc6176a081f2f6814f0c0504ddbfe30ff85c 1 parent a4f16d6
@kowshik kowshik authored
Showing with 6 additions and 5 deletions.
  1. +5 −4 spec/unit/json_message_spec.rb
  2. +1 −1  vcap_common.gemspec
View
9 spec/unit/json_message_spec.rb
@@ -203,13 +203,14 @@
@klass = Class.new(JsonMessage)
end
- it 'should raise a parse error when json passed is nil' do
- error_checker = lambda do |error|
+ it 'should raise a parse error when malformed json is passed' do
+ expect { @klass.decode("blah") }.to raise_error { |error|
error.should be_an_instance_of(JsonMessage::ParseError)
- error.message.should be_an_instance_of(String)
error.message.size.should > 0
- end
+ }
+ end
+ it 'should raise a parse error when json passed is nil' do
expect { @klass.decode(nil) }.to raise_error { |error|
error.should be_an_instance_of(JsonMessage::ParseError)
error.message.size.should > 0
View
2  vcap_common.gemspec
@@ -1,6 +1,6 @@
spec = Gem::Specification.new do |s|
s.name = 'vcap_common'
- s.version = '2.0.2'
+ s.version = '2.0.3'
s.date = '2012-07-05'
s.summary = 'vcap common'
s.homepage = "http://github.com/vmware-ac/core"
Please sign in to comment.
Something went wrong with that request. Please try again.