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 CHANGED
@@ -1,3 +1,6 @@
1
+ == Versão 1.3.1
2
+ - Correção: Passagem correta de parâmetros na criação da classe Correios::Frete::WebService no cálculo de frete.
3
+
1
4
  == Versão 1.3.0
2
5
  - Atualização: Refatoração das classes Correios::Frete::Calculador e Correios::Frete::WebService.
3
6
 
data/Gemfile CHANGED
@@ -9,4 +9,6 @@ group :development do
9
9
  gem "fakeweb", "~> 1.3.0"
10
10
  gem "jeweler", "~> 1.6.4"
11
11
  gem "rspec", "~> 2.6.0"
12
+ gem "ruby-debug", :platforms => :ruby_18
13
+ gem "ruby-debug19", :require => "ruby-debug", :platforms => :ruby_19
12
14
  end
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)
@@ -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.0"
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
 
@@ -51,7 +51,7 @@ module Correios
51
51
 
52
52
  private
53
53
 
54
- def web_service(*service_types)
54
+ def web_service(service_types)
55
55
  Correios::Frete::WebService.new(self, service_types)
56
56
  end
57
57
 
@@ -4,7 +4,7 @@ module Correios
4
4
  module Version
5
5
  MAJOR = 1
6
6
  MINOR = 3
7
- PATCH = 0
7
+ PATCH = 1
8
8
  VERSION = [MAJOR, MINOR, PATCH].join(".")
9
9
  end
10
10
  end
@@ -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.0
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: &812990 !ruby/object:Gem::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: *812990
25
+ version_requirements: *12353160
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: nokogiri
28
- requirement: &812300 !ruby/object:Gem::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: *812300
36
+ version_requirements: *12352920
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: sax-machine
39
- requirement: &811480 !ruby/object:Gem::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: *811480
47
+ version_requirements: *12352680
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: bundler
50
- requirement: &810950 !ruby/object:Gem::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: *810950
58
+ version_requirements: *12352440
59
59
  - !ruby/object:Gem::Dependency
60
60
  name: fakeweb
61
- requirement: &810220 !ruby/object:Gem::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: *810220
69
+ version_requirements: *12352200
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: jeweler
72
- requirement: &809550 !ruby/object:Gem::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: *809550
80
+ version_requirements: *12351960
81
81
  - !ruby/object:Gem::Dependency
82
82
  name: rspec
83
- requirement: &809070 !ruby/object:Gem::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: *809070
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.