correios-frete 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.rdoc +3 -0
- data/Gemfile +2 -0
- data/Gemfile.lock +24 -0
- data/correios-frete.gemspec +7 -1
- data/lib/correios/frete/calculador.rb +1 -1
- data/lib/correios/frete/version.rb +1 -1
- data/spec/correios/frete/calculador_spec.rb +12 -0
- metadata +37 -15
data/CHANGELOG.rdoc
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
GEM
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
|
+
archive-tar-minitar (0.5.2)
|
5
|
+
columnize (0.3.4)
|
4
6
|
diff-lcs (1.1.3)
|
5
7
|
fakeweb (1.3.0)
|
6
8
|
git (1.2.5)
|
@@ -8,9 +10,14 @@ GEM
|
|
8
10
|
bundler (~> 1.0)
|
9
11
|
git (>= 1.2.5)
|
10
12
|
rake
|
13
|
+
linecache (0.46)
|
14
|
+
rbx-require-relative (> 0.0.4)
|
15
|
+
linecache19 (0.5.12)
|
16
|
+
ruby_core_source (>= 0.1.4)
|
11
17
|
log-me (0.0.2)
|
12
18
|
nokogiri (1.4.7)
|
13
19
|
rake (0.9.2)
|
20
|
+
rbx-require-relative (0.0.5)
|
14
21
|
rspec (2.6.0)
|
15
22
|
rspec-core (~> 2.6.0)
|
16
23
|
rspec-expectations (~> 2.6.0)
|
@@ -19,6 +26,21 @@ GEM
|
|
19
26
|
rspec-expectations (2.6.0)
|
20
27
|
diff-lcs (~> 1.1.2)
|
21
28
|
rspec-mocks (2.6.0)
|
29
|
+
ruby-debug (0.10.4)
|
30
|
+
columnize (>= 0.1)
|
31
|
+
ruby-debug-base (~> 0.10.4.0)
|
32
|
+
ruby-debug-base (0.10.4)
|
33
|
+
linecache (>= 0.3)
|
34
|
+
ruby-debug-base19 (0.11.25)
|
35
|
+
columnize (>= 0.3.1)
|
36
|
+
linecache19 (>= 0.5.11)
|
37
|
+
ruby_core_source (>= 0.1.4)
|
38
|
+
ruby-debug19 (0.11.6)
|
39
|
+
columnize (>= 0.3.1)
|
40
|
+
linecache19 (>= 0.5.11)
|
41
|
+
ruby-debug-base19 (>= 0.11.19)
|
42
|
+
ruby_core_source (0.1.5)
|
43
|
+
archive-tar-minitar (>= 0.5.2)
|
22
44
|
sax-machine (0.0.20)
|
23
45
|
nokogiri (> 0.0.0)
|
24
46
|
|
@@ -32,4 +54,6 @@ DEPENDENCIES
|
|
32
54
|
log-me (~> 0.0.2)
|
33
55
|
nokogiri (~> 1.4.7)
|
34
56
|
rspec (~> 2.6.0)
|
57
|
+
ruby-debug
|
58
|
+
ruby-debug19
|
35
59
|
sax-machine (~> 0.0.20)
|
data/correios-frete.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{correios-frete}
|
8
|
-
s.version = "1.3.
|
8
|
+
s.version = "1.3.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Prodis a.k.a. Fernando Hamasaki"]
|
@@ -61,6 +61,8 @@ Gem::Specification.new do |s|
|
|
61
61
|
s.add_development_dependency(%q<fakeweb>, ["~> 1.3.0"])
|
62
62
|
s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
|
63
63
|
s.add_development_dependency(%q<rspec>, ["~> 2.6.0"])
|
64
|
+
s.add_development_dependency(%q<ruby-debug>, [">= 0"])
|
65
|
+
s.add_development_dependency(%q<ruby-debug19>, [">= 0"])
|
64
66
|
else
|
65
67
|
s.add_dependency(%q<log-me>, ["~> 0.0.2"])
|
66
68
|
s.add_dependency(%q<nokogiri>, ["~> 1.4.7"])
|
@@ -69,6 +71,8 @@ Gem::Specification.new do |s|
|
|
69
71
|
s.add_dependency(%q<fakeweb>, ["~> 1.3.0"])
|
70
72
|
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
71
73
|
s.add_dependency(%q<rspec>, ["~> 2.6.0"])
|
74
|
+
s.add_dependency(%q<ruby-debug>, [">= 0"])
|
75
|
+
s.add_dependency(%q<ruby-debug19>, [">= 0"])
|
72
76
|
end
|
73
77
|
else
|
74
78
|
s.add_dependency(%q<log-me>, ["~> 0.0.2"])
|
@@ -78,6 +82,8 @@ Gem::Specification.new do |s|
|
|
78
82
|
s.add_dependency(%q<fakeweb>, ["~> 1.3.0"])
|
79
83
|
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
80
84
|
s.add_dependency(%q<rspec>, ["~> 2.6.0"])
|
85
|
+
s.add_dependency(%q<ruby-debug>, [">= 0"])
|
86
|
+
s.add_dependency(%q<ruby-debug19>, [">= 0"])
|
81
87
|
end
|
82
88
|
end
|
83
89
|
|
@@ -64,6 +64,12 @@ describe Correios::Frete::Calculador do
|
|
64
64
|
context "to many services" do
|
65
65
|
before(:each) { fake_request_for(:success_response_many_services) }
|
66
66
|
|
67
|
+
it "creates a WebService with correct params" do
|
68
|
+
web_service = Correios::Frete::WebService.new @frete, [:pac, :sedex]
|
69
|
+
Correios::Frete::WebService.should_receive(:new).with(@frete, [:pac, :sedex]).and_return(web_service)
|
70
|
+
@frete.calcular(:pac, :sedex)
|
71
|
+
end
|
72
|
+
|
67
73
|
it "returns all services" do
|
68
74
|
@frete.calcular(:pac, :sedex).keys.should == [:pac, :sedex]
|
69
75
|
end
|
@@ -72,6 +78,12 @@ describe Correios::Frete::Calculador do
|
|
72
78
|
context "to one service" do
|
73
79
|
before(:each) { fake_request_for(:success_response_one_service) }
|
74
80
|
|
81
|
+
it "creates a WebService with correct params" do
|
82
|
+
web_service = Correios::Frete::WebService.new @frete, [:sedex]
|
83
|
+
Correios::Frete::WebService.should_receive(:new).with(@frete, [:sedex]).and_return(web_service)
|
84
|
+
@frete.calcular(:sedex)
|
85
|
+
end
|
86
|
+
|
75
87
|
it "returns only one service" do
|
76
88
|
@frete.calcular(:sedex).tipo.should == :sedex
|
77
89
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: correios-frete
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -14,7 +14,7 @@ default_executable:
|
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: log-me
|
17
|
-
requirement: &
|
17
|
+
requirement: &12353160 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ~>
|
@@ -22,10 +22,10 @@ dependencies:
|
|
22
22
|
version: 0.0.2
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *12353160
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: nokogiri
|
28
|
-
requirement: &
|
28
|
+
requirement: &12352920 !ruby/object:Gem::Requirement
|
29
29
|
none: false
|
30
30
|
requirements:
|
31
31
|
- - ~>
|
@@ -33,10 +33,10 @@ dependencies:
|
|
33
33
|
version: 1.4.7
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
|
-
version_requirements: *
|
36
|
+
version_requirements: *12352920
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
38
|
name: sax-machine
|
39
|
-
requirement: &
|
39
|
+
requirement: &12352680 !ruby/object:Gem::Requirement
|
40
40
|
none: false
|
41
41
|
requirements:
|
42
42
|
- - ~>
|
@@ -44,10 +44,10 @@ dependencies:
|
|
44
44
|
version: 0.0.20
|
45
45
|
type: :runtime
|
46
46
|
prerelease: false
|
47
|
-
version_requirements: *
|
47
|
+
version_requirements: *12352680
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
49
|
name: bundler
|
50
|
-
requirement: &
|
50
|
+
requirement: &12352440 !ruby/object:Gem::Requirement
|
51
51
|
none: false
|
52
52
|
requirements:
|
53
53
|
- - ~>
|
@@ -55,10 +55,10 @@ dependencies:
|
|
55
55
|
version: 1.0.0
|
56
56
|
type: :development
|
57
57
|
prerelease: false
|
58
|
-
version_requirements: *
|
58
|
+
version_requirements: *12352440
|
59
59
|
- !ruby/object:Gem::Dependency
|
60
60
|
name: fakeweb
|
61
|
-
requirement: &
|
61
|
+
requirement: &12352200 !ruby/object:Gem::Requirement
|
62
62
|
none: false
|
63
63
|
requirements:
|
64
64
|
- - ~>
|
@@ -66,10 +66,10 @@ dependencies:
|
|
66
66
|
version: 1.3.0
|
67
67
|
type: :development
|
68
68
|
prerelease: false
|
69
|
-
version_requirements: *
|
69
|
+
version_requirements: *12352200
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
71
|
name: jeweler
|
72
|
-
requirement: &
|
72
|
+
requirement: &12351960 !ruby/object:Gem::Requirement
|
73
73
|
none: false
|
74
74
|
requirements:
|
75
75
|
- - ~>
|
@@ -77,10 +77,10 @@ dependencies:
|
|
77
77
|
version: 1.6.4
|
78
78
|
type: :development
|
79
79
|
prerelease: false
|
80
|
-
version_requirements: *
|
80
|
+
version_requirements: *12351960
|
81
81
|
- !ruby/object:Gem::Dependency
|
82
82
|
name: rspec
|
83
|
-
requirement: &
|
83
|
+
requirement: &12351720 !ruby/object:Gem::Requirement
|
84
84
|
none: false
|
85
85
|
requirements:
|
86
86
|
- - ~>
|
@@ -88,7 +88,29 @@ dependencies:
|
|
88
88
|
version: 2.6.0
|
89
89
|
type: :development
|
90
90
|
prerelease: false
|
91
|
-
version_requirements: *
|
91
|
+
version_requirements: *12351720
|
92
|
+
- !ruby/object:Gem::Dependency
|
93
|
+
name: ruby-debug
|
94
|
+
requirement: &12351480 !ruby/object:Gem::Requirement
|
95
|
+
none: false
|
96
|
+
requirements:
|
97
|
+
- - ! '>='
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: '0'
|
100
|
+
type: :development
|
101
|
+
prerelease: false
|
102
|
+
version_requirements: *12351480
|
103
|
+
- !ruby/object:Gem::Dependency
|
104
|
+
name: ruby-debug19
|
105
|
+
requirement: &12351240 !ruby/object:Gem::Requirement
|
106
|
+
none: false
|
107
|
+
requirements:
|
108
|
+
- - ! '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
type: :development
|
112
|
+
prerelease: false
|
113
|
+
version_requirements: *12351240
|
92
114
|
description: Cálculo de frete utilizando o Web Service dos Correios (http://www.correios.com.br/webservices).
|
93
115
|
Os serviços de frete suportados são PAC, SEDEX, SEDEX a Cobrar, SEDEX 10, SEDEX
|
94
116
|
Hoje e e-SEDEX.
|