cielox 0.0.4a → 0.0.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/cielox.gemspec CHANGED
@@ -16,7 +16,7 @@ Gem::Specification.new do |gem|
16
16
  gem.version = Cielo::VERSION
17
17
 
18
18
  gem.add_dependency "happymapper", "~> 0.4.0"
19
- gem.add_development_dependency "rspec", "~> 2.9.0"
20
- gem.add_development_dependency "timecop", "~> 0.3.5"
21
- gem.add_development_dependency "webmock", "~> 1.8.6"
19
+ gem.add_development_dependency "rspec", "~> 2.11.0"
20
+ gem.add_development_dependency "timecop", "~> 0.5.2"
21
+ gem.add_development_dependency "webmock", "~> 1.8.11"
22
22
  end
data/lib/cielo/order.rb CHANGED
@@ -8,5 +8,6 @@ module Cielo
8
8
  element :currency, String, :tag => "moeda"
9
9
  element :time, Time, :tag => "data-hora", :on_save => proc { |value| value.strftime("%Y-%m-%dT%H:%M:%S") }
10
10
  element :language, String, :tag => "idioma"
11
+ element :soft_descriptor, String, :tag => "soft-descriptor"
11
12
  end
12
13
  end
data/lib/cielo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Cielo
2
- VERSION = "0.0.4a"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -21,4 +21,17 @@ describe Cielo::Order do
21
21
 
22
22
  xml.should == File.read(File.expand_path("../../fixtures/order.xml", __FILE__))
23
23
  end
24
+
25
+ describe "with soft descriptor" do
26
+ it "#to_xml" do
27
+ subject.number = 285813768
28
+ subject.total = 1
29
+ subject.currency = 986
30
+ subject.time = Time.now
31
+ subject.language = "PT"
32
+ subject.soft_descriptor = "CieloX Store"
33
+
34
+ expect(subject.to_xml).to eq(File.read(File.expand_path("../../fixtures/order_2.xml", __FILE__)))
35
+ end
36
+ end
24
37
  end
@@ -10,15 +10,15 @@ describe Cielo::Card::Validity do
10
10
  end
11
11
 
12
12
  it "raises an exception if year is not valid" do
13
- expect { described_class.new(Time.now.year - 1, Time.now.month) }.should raise_error(described_class::InvalidDate)
13
+ expect { described_class.new(Time.now.year - 1, Time.now.month) }.to raise_error(described_class::InvalidDate)
14
14
  end
15
15
 
16
16
  it "raises an exception if month is not valid" do
17
- expect { described_class.new(Time.now.year, Time.now.month - 1) }.should raise_error(described_class::InvalidDate)
17
+ expect { described_class.new(Time.now.year, Time.now.month - 1) }.to raise_error(described_class::InvalidDate)
18
18
  end
19
19
 
20
20
  it "raises an exception if both year and month are not valid" do
21
- expect { described_class.new(Time.now.year - 1, Time.now.month - 1) }.should raise_error(described_class::InvalidDate)
21
+ expect { described_class.new(Time.now.year - 1, Time.now.month - 1) }.to raise_error(described_class::InvalidDate)
22
22
  end
23
23
 
24
24
  describe "#to_s" do
data/spec/cielo_spec.rb CHANGED
@@ -2,12 +2,12 @@ require "spec_helper"
2
2
 
3
3
  describe Cielo do
4
4
  it "returns a configuration instance" do
5
- Cielo.configuration.should be_instance_of(Cielo::Configuration)
5
+ expect(Cielo.configuration).to be_instance_of(Cielo::Configuration)
6
6
  end
7
7
 
8
8
  it "yields a configuration instance" do
9
9
  configuration = nil
10
10
  Cielo.configure { |c| configuration = c }
11
- configuration.should be_instance_of(Cielo::Configuration)
11
+ expect(configuration).to be_instance_of(Cielo::Configuration)
12
12
  end
13
13
  end
@@ -0,0 +1,9 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <dados-pedido>
3
+ <numero>285813768</numero>
4
+ <valor>100</valor>
5
+ <moeda>986</moeda>
6
+ <data-hora>2010-07-14T13:56:12</data-hora>
7
+ <idioma>PT</idioma>
8
+ <soft-descriptor>CieloX Store</soft-descriptor>
9
+ </dados-pedido>
metadata CHANGED
@@ -1,19 +1,19 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cielox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4a
5
- prerelease: 5
4
+ version: 0.0.4
5
+ prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - Rafael Souza
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-25 00:00:00.000000000 Z
12
+ date: 2012-10-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: happymapper
16
- requirement: &70272446273280 !ruby/object:Gem::Requirement
16
+ requirement: &70166783530980 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,40 +21,40 @@ dependencies:
21
21
  version: 0.4.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70272446273280
24
+ version_requirements: *70166783530980
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rspec
27
- requirement: &70272446272780 !ruby/object:Gem::Requirement
27
+ requirement: &70166783530420 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
31
31
  - !ruby/object:Gem::Version
32
- version: 2.9.0
32
+ version: 2.11.0
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70272446272780
35
+ version_requirements: *70166783530420
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: timecop
38
- requirement: &70272446272320 !ruby/object:Gem::Requirement
38
+ requirement: &70166783529860 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
42
42
  - !ruby/object:Gem::Version
43
- version: 0.3.5
43
+ version: 0.5.2
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70272446272320
46
+ version_requirements: *70166783529860
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: webmock
49
- requirement: &70272446271860 !ruby/object:Gem::Requirement
49
+ requirement: &70166783529200 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
53
53
  - !ruby/object:Gem::Version
54
- version: 1.8.6
54
+ version: 1.8.11
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70272446271860
57
+ version_requirements: *70166783529200
58
58
  description: Gem for integration with Cielo
59
59
  email:
60
60
  - me@rafaelss.com
@@ -114,6 +114,7 @@ files:
114
114
  - spec/fixtures/info_request/request.xml
115
115
  - spec/fixtures/info_request/response.xml
116
116
  - spec/fixtures/order.xml
117
+ - spec/fixtures/order_2.xml
117
118
  - spec/fixtures/payment.xml
118
119
  - spec/fixtures/shop.xml
119
120
  - spec/fixtures/transaction.xml
@@ -139,9 +140,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
139
140
  required_rubygems_version: !ruby/object:Gem::Requirement
140
141
  none: false
141
142
  requirements:
142
- - - ! '>'
143
+ - - ! '>='
143
144
  - !ruby/object:Gem::Version
144
- version: 1.3.1
145
+ version: '0'
145
146
  requirements: []
146
147
  rubyforge_project:
147
148
  rubygems_version: 1.8.11
@@ -172,6 +173,7 @@ test_files:
172
173
  - spec/fixtures/info_request/request.xml
173
174
  - spec/fixtures/info_request/response.xml
174
175
  - spec/fixtures/order.xml
176
+ - spec/fixtures/order_2.xml
175
177
  - spec/fixtures/payment.xml
176
178
  - spec/fixtures/shop.xml
177
179
  - spec/fixtures/transaction.xml