hashrocket-mousetrap 0.2.0 → 0.2.1
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/Rakefile +1 -1
- data/VERSION +1 -1
- data/mousetrap.gemspec +4 -4
- data/spec/integration/smoke_test.rb +6 -67
- data/spec/integration/spike.rb +11 -63
- data/spec/mousetrap/customer_spec.rb +2 -1
- metadata +4 -3
data/Rakefile
CHANGED
@@ -10,7 +10,7 @@ begin
|
|
10
10
|
gem.email = "jonlarkowski@gmail.com"
|
11
11
|
gem.homepage = "http://github.com/hashrocket/mousetrap"
|
12
12
|
gem.authors = ["Jon Larkowski", "Sandro Turriate", "Wolfram Arnold", "Corey Grusden"]
|
13
|
-
gem.add_dependency 'httparty', '>= 0.4.
|
13
|
+
gem.add_dependency 'httparty', '>= 0.4.2'
|
14
14
|
gem.add_development_dependency "activesupport", '>= 2.3.3'
|
15
15
|
gem.add_development_dependency "rspec", '>= 1.2.8'
|
16
16
|
gem.add_development_dependency 'thoughtbot-factory_girl', '>= 1.2.2'
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.1
|
data/mousetrap.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{mousetrap}
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.1"
|
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"]
|
@@ -64,18 +64,18 @@ Gem::Specification.new do |s|
|
|
64
64
|
s.specification_version = 3
|
65
65
|
|
66
66
|
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
67
|
-
s.add_runtime_dependency(%q<httparty>, [">= 0.4.
|
67
|
+
s.add_runtime_dependency(%q<httparty>, [">= 0.4.2"])
|
68
68
|
s.add_development_dependency(%q<activesupport>, [">= 2.3.3"])
|
69
69
|
s.add_development_dependency(%q<rspec>, [">= 1.2.8"])
|
70
70
|
s.add_development_dependency(%q<thoughtbot-factory_girl>, [">= 1.2.2"])
|
71
71
|
else
|
72
|
-
s.add_dependency(%q<httparty>, [">= 0.4.
|
72
|
+
s.add_dependency(%q<httparty>, [">= 0.4.2"])
|
73
73
|
s.add_dependency(%q<activesupport>, [">= 2.3.3"])
|
74
74
|
s.add_dependency(%q<rspec>, [">= 1.2.8"])
|
75
75
|
s.add_dependency(%q<thoughtbot-factory_girl>, [">= 1.2.2"])
|
76
76
|
end
|
77
77
|
else
|
78
|
-
s.add_dependency(%q<httparty>, [">= 0.4.
|
78
|
+
s.add_dependency(%q<httparty>, [">= 0.4.2"])
|
79
79
|
s.add_dependency(%q<activesupport>, [">= 2.3.3"])
|
80
80
|
s.add_dependency(%q<rspec>, [">= 1.2.8"])
|
81
81
|
s.add_dependency(%q<thoughtbot-factory_girl>, [">= 1.2.2"])
|
@@ -1,77 +1,16 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
1
2
|
require File.dirname(__FILE__) + '/../../lib/mousetrap'
|
2
3
|
require 'yaml'
|
3
4
|
require 'activesupport'
|
4
5
|
|
5
|
-
# Requires supporting files with custom matchers and macros, etc,
|
6
|
-
# in ./support/ and its subdirectories.
|
7
6
|
Dir["#{File.dirname(__FILE__)}/../support/**/*.rb"].each {|f| require f}
|
8
7
|
|
9
8
|
settings = YAML.load_file(File.dirname(__FILE__) + '/settings.yml')
|
10
9
|
Mousetrap.authenticate(settings['user'], settings['password'])
|
11
10
|
Mousetrap.product_code = settings['product_code']
|
12
11
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
all_customers.each { |c| c.destroy }
|
20
|
-
|
21
|
-
all_customers = Mousetrap::Customer.all
|
22
|
-
puts all_customers.inspect
|
23
|
-
puts all_customers.to_yaml
|
24
|
-
|
25
|
-
__END__
|
26
|
-
|
27
|
-
code = 'maasdxgliu@example.com'
|
28
|
-
c = Mousetrap::Customer[code]
|
29
|
-
puts c.to_yaml
|
30
|
-
c.destroy
|
31
|
-
|
32
|
-
puts '-' * 80
|
33
|
-
c = Mousetrap::Customer[code]
|
34
|
-
puts c.to_yaml
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
email = random_email_address
|
41
|
-
attributes = {
|
42
|
-
'code' => email,
|
43
|
-
'firstName' => 'Example',
|
44
|
-
'lastName' => 'Customer',
|
45
|
-
'email' => email,
|
46
|
-
'subscription' => {
|
47
|
-
'planCode' => 'TEST',
|
48
|
-
'ccFirstName' => 'Jon',
|
49
|
-
'ccLastName' => 'Larkowski',
|
50
|
-
'ccNumber' => '4111111111111111',
|
51
|
-
'ccExpiration' => '12-2012',
|
52
|
-
'ccZip' => '90210'
|
53
|
-
}
|
54
|
-
}
|
55
|
-
|
56
|
-
customer = Mousetrap::Customer.create attributes
|
57
|
-
puts customer
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
puts Mousetrap::Plan.all.to_yaml
|
63
|
-
puts Mousetrap::Customer['maasdxgliu@example.com'].to_yaml
|
64
|
-
puts Mousetrap::Plan['TEST'].to_yaml
|
65
|
-
puts Mousetrap::Customer.all.to_yaml
|
66
|
-
|
67
|
-
|
68
|
-
customers_hash = Mousetrap::Customer['maasdxgliu@example.com']
|
69
|
-
customer_hash = customers_hash['customers']['customer'].slice 'firstName', 'lastName', 'email', 'code'
|
70
|
-
customer = Mousetrap::Customer.new customer_hash
|
71
|
-
|
72
|
-
customer.first_name = random_string
|
73
|
-
puts customer.save!
|
74
|
-
|
75
|
-
customer_hash = Mousetrap::Customer['maasdxgliu@example.com']
|
76
|
-
puts customer_hash.to_yaml
|
77
|
-
|
12
|
+
describe "The Wrapper Gem" do
|
13
|
+
it "works" do
|
14
|
+
true.should be_true
|
15
|
+
end
|
16
|
+
end
|
data/spec/integration/spike.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# This script is for hacking and playing around.
|
2
|
+
|
1
3
|
require File.dirname(__FILE__) + '/../../lib/mousetrap'
|
2
4
|
require 'activesupport'
|
3
5
|
require 'factory_girl'
|
@@ -10,6 +12,7 @@ settings = YAML.load_file(File.dirname(__FILE__) + '/settings.yml')
|
|
10
12
|
Mousetrap.authenticate(settings['user'], settings['password'])
|
11
13
|
Mousetrap.product_code = settings['product_code']
|
12
14
|
|
15
|
+
|
13
16
|
def plans
|
14
17
|
all_plans = Mousetrap::Plan.all
|
15
18
|
puts all_plans.to_yaml
|
@@ -18,76 +21,21 @@ def plans
|
|
18
21
|
puts test_plan.to_yaml
|
19
22
|
end
|
20
23
|
|
21
|
-
|
22
24
|
def customers
|
23
|
-
all_customers = Mousetrap::Customer.all
|
24
|
-
puts all_customers.to_yaml
|
25
|
-
all_customers.each { |c| c.destroy }
|
26
|
-
|
27
25
|
customer = Factory :new_customer
|
28
26
|
customer.save
|
29
27
|
|
30
28
|
api_customer = Mousetrap::Customer[customer.code]
|
31
29
|
puts api_customer.to_yaml
|
32
30
|
|
33
|
-
all_customers = Mousetrap::Customer.all
|
34
|
-
puts all_customers.to_yaml
|
31
|
+
#all_customers = Mousetrap::Customer.all
|
32
|
+
#puts all_customers.to_yaml
|
35
33
|
end
|
36
34
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
__END__
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
all_customers = Mousetrap::Customer.all
|
48
|
-
puts all_customers.inspect
|
49
|
-
puts all_customers.to_yaml
|
50
|
-
|
51
|
-
|
52
|
-
code = 'maasdxgliu@example.com'
|
53
|
-
c = Mousetrap::Customer[code]
|
54
|
-
puts c.to_yaml
|
55
|
-
c.destroy
|
56
|
-
|
57
|
-
puts '-' * 80
|
58
|
-
c = Mousetrap::Customer[code]
|
59
|
-
puts c.to_yaml
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
email = random_email_address
|
66
|
-
attributes = {
|
67
|
-
'code' => email,
|
68
|
-
'firstName' => 'Example',
|
69
|
-
'lastName' => 'Customer',
|
70
|
-
'email' => email,
|
71
|
-
'subscription' => {
|
72
|
-
'planCode' => 'TEST',
|
73
|
-
'ccFirstName' => 'Jon',
|
74
|
-
'ccLastName' => 'Larkowski',
|
75
|
-
'ccNumber' => '4111111111111111',
|
76
|
-
'ccExpiration' => '12-2012',
|
77
|
-
'ccZip' => '90210'
|
78
|
-
}
|
79
|
-
}
|
80
|
-
|
81
|
-
customer = Mousetrap::Customer.create attributes
|
82
|
-
puts customer
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
customers_hash = Mousetrap::Customer['maasdxgliu@example.com']
|
88
|
-
customer_hash = customers_hash['customers']['customer'].slice 'firstName', 'lastName', 'email', 'code'
|
89
|
-
customer = Mousetrap::Customer.new customer_hash
|
90
|
-
|
91
|
-
customer.first_name = random_string
|
92
|
-
puts customer.save!
|
35
|
+
def destroy_all_customers
|
36
|
+
all_customers = Mousetrap::Customer.all
|
37
|
+
all_customers.each { |c| c.destroy }
|
38
|
+
end
|
93
39
|
|
40
|
+
#destroy_all_customers
|
41
|
+
#customers
|
@@ -12,7 +12,8 @@ describe Mousetrap::Customer do
|
|
12
12
|
:ccFirstName => customer.subscription.billing_first_name,
|
13
13
|
:ccLastName => customer.subscription.billing_last_name,
|
14
14
|
:ccNumber => customer.subscription.credit_card_number,
|
15
|
-
:
|
15
|
+
:ccExpMonth => customer.subscription.credit_card_expiration_month,
|
16
|
+
:ccExpYear => customer.subscription.credit_card_expiration_year,
|
16
17
|
:ccZip => customer.subscription.billing_zip_code,
|
17
18
|
}
|
18
19
|
}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hashrocket-mousetrap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jon Larkowski
|
@@ -23,7 +23,7 @@ dependencies:
|
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.4.
|
26
|
+
version: 0.4.2
|
27
27
|
version:
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: activesupport
|
@@ -90,6 +90,7 @@ files:
|
|
90
90
|
- spec/support/random_data.rb
|
91
91
|
has_rdoc: false
|
92
92
|
homepage: http://github.com/hashrocket/mousetrap
|
93
|
+
licenses:
|
93
94
|
post_install_message:
|
94
95
|
rdoc_options:
|
95
96
|
- --charset=UTF-8
|
@@ -110,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
110
111
|
requirements: []
|
111
112
|
|
112
113
|
rubyforge_project:
|
113
|
-
rubygems_version: 1.
|
114
|
+
rubygems_version: 1.3.5
|
114
115
|
signing_key:
|
115
116
|
specification_version: 3
|
116
117
|
summary: CheddarGetter API Client in Ruby
|