Skip to content

Instantly share code, notes, and snippets.

@Neener54
Created August 16, 2013 22:51
Show Gist options
  • Save Neener54/6254190 to your computer and use it in GitHub Desktop.
Save Neener54/6254190 to your computer and use it in GitHub Desktop.
Best Stubbing Ever
item.stub(:[]).and_return('1')
item.stub(:[]).with(:name).and_return('Foo Inc')
item.stub(:[]).with(:thing_id).and_return(%w(1))
item.stub(:[]).with(:error_description).and_return(['Successful'])
item.stub(:to_json).and_return('json data')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment