Browse files

Switch to testing with multi_json instead of oj due to travis build e…

…rrors
  • Loading branch information...
1 parent 094b7e8 commit dbf9f04c17ebf05929633ff6977cf0427badd4b9 @timcraft timcraft committed Nov 16, 2012
Showing with 12 additions and 21 deletions.
  1. +9 −17 README.md
  2. +1 −1 nexmo.gemspec
  3. +2 −3 spec/nexmo_spec.rb
View
26 README.md
@@ -22,35 +22,27 @@ nexmo.send_message!({:to => '...NUMBER...', :from => 'Ruby', :text => 'Hello wor
```
This method call returns the message id if the message was sent successfully,
-or raises an exception if there was an error.
-
-
-Handling Errors
----------------
-
-For more robust error handling use the `send_message` method instead.
-This returns the HTTP response wrapped in a `Nexmo::Response` object.
+or raises an exception if there was an error. For more robust error handling
+use the `send_message` method instead. This returns the HTTP response wrapped
+in a `Nexmo::Response` object.
JSON Implementation
-------------------
The "json" library is used by default. This is available in the Ruby 1.9
-standard library, and as a gem for Ruby 1.8.
-
-You can specify which implementation you wish to use explicitly when
-constructing a client object. For example, here is how you would use
-[oj](https://rubygems.org/gems/oj):
+standard library, and as a gem for Ruby 1.8. You can specify an alternate
+implementation that you wish to use explicitly when constructing a client
+object. For example, to use [multi_json](https://rubygems.org/gems/multi_json):
```ruby
require 'nexmo'
-require 'oj'
+require 'multi_json'
-nexmo = Nexmo::Client.new('...API KEY...', '...API SECRET...', :json => Oj)
+nexmo = Nexmo::Client.new('...API KEY...', '...API SECRET...', :json => MultiJson)
```
-Ditto for MultiJSON, or anything that is compatible with the interface
-of the default implementation.
+Ditto for anything that is compatible with the default implementation.
Troubleshooting
View
2 nexmo.gemspec
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
s.files = Dir.glob('{lib,spec}/**/*') + %w(README.md nexmo.gemspec)
s.add_development_dependency('rake', '>= 0.9.3')
s.add_development_dependency('mocha', '~> 0.10.3')
- s.add_development_dependency('oj', '~> 1.3.7')
+ s.add_development_dependency('multi_json', '~> 1.3.6')
s.require_path = 'lib'
if RUBY_VERSION == '1.8.7'
View
5 spec/nexmo_spec.rb
@@ -1,7 +1,6 @@
require 'minitest/autorun'
require 'mocha'
-require 'oj'
-
+require 'multi_json'
require 'nexmo'
describe 'Nexmo::Client' do
@@ -194,7 +193,7 @@
before do
@http_response = mock()
- @response = Nexmo::Response.new(@http_response, :json => Oj)
+ @response = Nexmo::Response.new(@http_response, :json => MultiJson)
end
describe 'object method' do

0 comments on commit dbf9f04

Please sign in to comment.