mousetrap 0.4.3 → 0.4.4

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.3
1
+ 0.4.4
@@ -67,7 +67,7 @@ module Mousetrap
67
67
  response = get_resources 'customers'
68
68
 
69
69
  if response['error']
70
- if response['error'] == 'Resource not found: No customers found.'
70
+ if response['error'] =~ /No customers found/
71
71
  return []
72
72
  else
73
73
  raise response['error']
@@ -79,10 +79,7 @@ module Mousetrap
79
79
 
80
80
  def self.create(attributes)
81
81
  object = new(attributes)
82
- response = object.save
83
- returned_customer = build_resource_from response
84
- object.id = returned_customer.id
85
- # TODO: what other attrs to copy over?
82
+ object.send(:create)
86
83
  object
87
84
  end
88
85
 
@@ -19,7 +19,7 @@ module Mousetrap
19
19
  response = get_resource plural_resource_name, code
20
20
 
21
21
  if response['error']
22
- if response['error'] =~ /Resource not found/
22
+ if response['error'] =~ /not found/
23
23
  return nil
24
24
  else
25
25
  raise response['error']
data/mousetrap.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{mousetrap}
8
- s.version = "0.4.3"
8
+ s.version = "0.4.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jon Larkowski", "Sandro Turriate", "Wolfram Arnold", "Corey Grusden"]
12
- s.date = %q{2009-10-22}
12
+ s.date = %q{2009-10-23}
13
13
  s.description = %q{CheddarGetter API Client in Ruby}
14
14
  s.email = %q{jonlarkowski@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -63,7 +63,7 @@ describe Mousetrap::Customer do
63
63
  before do
64
64
  @customer_hash = Factory.attributes_for :new_customer
65
65
  @customer = Mousetrap::Customer.new @customer_hash
66
- @customer.stub(:save)
66
+ @customer.stub :create
67
67
  Mousetrap::Customer.stub(:new => @customer)
68
68
  Mousetrap::Customer.stub(:build_resource_from => stub(:id => 0))
69
69
  end
@@ -73,14 +73,8 @@ describe Mousetrap::Customer do
73
73
  Mousetrap::Customer.create(@customer_hash)
74
74
  end
75
75
 
76
- it 'saves the new customer instance' do
77
- @customer.should_receive(:save)
78
- Mousetrap::Customer.create(@customer_hash)
79
- end
80
-
81
- it 'sets the id of the newly created customer' do
82
- Mousetrap::Customer.stub(:build_resource_from => stub(:id => 1))
83
- @customer.should_receive(:id=).with(1)
76
+ it 'creates the new customer instance' do
77
+ @customer.should_receive :create
84
78
  Mousetrap::Customer.create(@customer_hash)
85
79
  end
86
80
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mousetrap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Larkowski
@@ -12,7 +12,7 @@ autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
14
 
15
- date: 2009-10-22 00:00:00 -04:00
15
+ date: 2009-10-23 00:00:00 -04:00
16
16
  default_executable:
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency