Skip to content

Instantly share code, notes, and snippets.

@samstarling
Created May 2, 2012 12:52
Show Gist options
  • Save samstarling/2576337 to your computer and use it in GitHub Desktop.
Save samstarling/2576337 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'rest-assured'
RestAssured::Double.create(fullpath: '/products', content: 'this is content')
---
gives me...
---
/Users/starls01/.rvm/gems/ruby-1.9.3-p125/gems/activeresource-3.2.3/lib/active_resource/base.rb:588:in `prefix': undefined method `path' for nil:NilClass (NoMethodError)
from /Users/starls01/.rvm/gems/ruby-1.9.3-p125/gems/activeresource-3.2.3/lib/active_resource/base.rb:598:in `prefix_source'
from /Users/starls01/.rvm/gems/ruby-1.9.3-p125/gems/activeresource-3.2.3/lib/active_resource/base.rb:952:in `prefix_parameters'
from /Users/starls01/.rvm/gems/ruby-1.9.3-p125/gems/activeresource-3.2.3/lib/active_resource/base.rb:967:in `block in split_options'
from /Users/starls01/.rvm/gems/ruby-1.9.3-p125/gems/activeresource-3.2.3/lib/active_resource/base.rb:965:in `each'
from /Users/starls01/.rvm/gems/ruby-1.9.3-p125/gems/activeresource-3.2.3/lib/active_resource/base.rb:965:in `split_options'
from /Users/starls01/.rvm/gems/ruby-1.9.3-p125/gems/activeresource-3.2.3/lib/active_resource/base.rb:1454:in `split_options'
from /Users/starls01/.rvm/gems/ruby-1.9.3-p125/gems/activeresource-3.2.3/lib/active_resource/base.rb:1257:in `load'
from /Users/starls01/.rvm/gems/ruby-1.9.3-p125/gems/activeresource-3.2.3/lib/active_resource/base.rb:1007:in `initialize'
from /Users/starls01/.rvm/gems/ruby-1.9.3-p125/gems/activeresource-3.2.3/lib/active_resource/base.rb:747:in `new'
from /Users/starls01/.rvm/gems/ruby-1.9.3-p125/gems/activeresource-3.2.3/lib/active_resource/base.rb:747:in `create'
from test.rb:4:in `<main>'
@stuarthicks
Copy link

Dunno if you ever found the answer, but I just stumbled across this randomly while searching for a different problem and if you are still wondering about this then you need to call start() first before you can create any doubles.

eg:

RestAssured::Server.start(:database => ':memory:')`

(It's not a great error message, is it... 😄)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment