mousetrap 0.4.3 → 0.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/lib/mousetrap/customer.rb +2 -5
- data/lib/mousetrap/resource.rb +1 -1
- data/mousetrap.gemspec +2 -2
- data/spec/mousetrap/customer_spec.rb +3 -9
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.4
|
data/lib/mousetrap/customer.rb
CHANGED
@@ -67,7 +67,7 @@ module Mousetrap
|
|
67
67
|
response = get_resources 'customers'
|
68
68
|
|
69
69
|
if response['error']
|
70
|
-
if response['error']
|
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
|
-
|
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
|
|
data/lib/mousetrap/resource.rb
CHANGED
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.
|
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-
|
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
|
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 '
|
77
|
-
@customer.should_receive
|
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.
|
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-
|
15
|
+
date: 2009-10-23 00:00:00 -04:00
|
16
16
|
default_executable:
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|