russianpost 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8086e933ce655cad0fbb89201061bdd0874ffba7
4
- data.tar.gz: ca8eb67058f2b8ae264cf0b615d5c33379a3cd5f
3
+ metadata.gz: 82573cc61a9559f67a85f8d49564460d6c99d593
4
+ data.tar.gz: 0f0463f91a86d28b1666d405305c46841db593ea
5
5
  SHA512:
6
- metadata.gz: 426c67bbe5a25b333a19e521f22ad159cfe328f992df927d1c128e50f584e51232246b49615c535205ddd6baf38e7f24b2bf4b8904b107f9da85755ab0b9420c
7
- data.tar.gz: f6862f03ba823fd8dc6d8467b06dc2cbbf93277faa58c2827417bbc2b82b45eff94198d1abaca6084f91bf335f5e8a6ae2e2e00371ce88d7de4f9505f2064561
6
+ metadata.gz: 782fffaa94b8bbe08c2ee98ffb5ee5d2291e81b349ab567d0f248f4e852b3aa88bef7bd07c68cdca9ceb4b1544cc2ee34ef9a7acbfd67f29747e43b38d9bdc66
7
+ data.tar.gz: e091b25a0faae0038f7d6bad7bfd8d3f1d41957fc0260023627f74d2c930e9229ab274ed35b4fc766071b1dbcd884eb00ed305b7c90bee2ad8aba9d37b368788
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![Build Status](https://travis-ci.org/artemshitov/russianpost.png?branch=master)](https://travis-ci.org/artemshitov/russianpost) [![Code Climate](https://codeclimate.com/github/artemshitov/russianpost.png)](https://codeclimate.com/github/artemshitov/russianpost)
4
4
 
5
- Thin wrapper around Russian Post package tracking SOAP API. Works on a per-package basis (contrary to the bulk ticket-based API). Use it at your own risk, since the API may appear unstable and require authorization in future.
5
+ Ruby wrapper around Russian Post package tracking SOAP API. Works on a per-package basis (contrary to the bulk ticket-based API). Use it at your own risk, since the API may appear unstable and require authorization in future.
6
6
 
7
7
  ## Installation
8
8
 
@@ -12,7 +12,7 @@ To install gem stand-alone:
12
12
 
13
13
  To use gem in a Rails app, add the following to your `Gemfile`:
14
14
 
15
- gem "russianpost", "~> 0.4.0"
15
+ gem "russianpost", "~> 0.4.1"
16
16
 
17
17
  This gem uses [Savon](http://savonrb.com/), which in turn uses [HTTPI](https://github.com/savonrb/httpi) internally. HTTPI chooses the best HTTP library of those you have installed. For the fastest results, make sure you add [Curb](https://github.com/taf2/curb) to your `Gemfile`:
18
18
 
@@ -1,3 +1,4 @@
1
+ require "forwardable"
1
2
  require "russianpost/barcode_validator"
2
3
 
3
4
  module RussianPost
@@ -1,3 +1,3 @@
1
1
  module Russianpost
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1"
3
3
  end
@@ -1,23 +1,25 @@
1
1
  require "test_helper"
2
2
  require "russianpost/barcode"
3
3
 
4
- class BarcodeTest < MiniTest::Unit::TestCase
5
- def test_implicitly_converts_to_string
6
- barcode = RussianPost::Barcode.new("RD025500807SE")
7
- assert_equal "bar RD025500807SE", "bar #{barcode}"
8
- end
4
+ module RussianPost
5
+ class BarcodeTest < MiniTest::Unit::TestCase
6
+ def test_implicitly_converts_to_string
7
+ barcode = Barcode.new("RD025500807SE")
8
+ assert_equal "bar RD025500807SE", "bar #{barcode}"
9
+ end
9
10
 
10
- def test_raises_on_invalid_barcode
11
- ["123", "RR123456789EE"].each do |barcode|
12
- assert_raises RussianPost::InvalidBarcode do
13
- RussianPost::Barcode.new(barcode)
11
+ def test_raises_on_invalid_barcode
12
+ ["123", "RR123456789EE"].each do |barcode|
13
+ assert_raises InvalidBarcode do
14
+ Barcode.new(barcode)
15
+ end
14
16
  end
15
17
  end
16
- end
17
18
 
18
- def test_doesnt_raise_on_valid_barcode
19
- ["RD025500807SE", "12345678901234"].each do |barcode|
20
- RussianPost::Barcode.new(barcode)
19
+ def test_doesnt_raise_on_valid_barcode
20
+ ["RD025500807SE", "12345678901234"].each do |barcode|
21
+ Barcode.new(barcode)
22
+ end
21
23
  end
22
24
  end
23
25
  end
@@ -3,60 +3,62 @@
3
3
  require "test_helper"
4
4
  require "russianpost/parcel"
5
5
 
6
- class ParcelTest < MiniTest::Unit::TestCase
7
- def test_returns_array_of_operations
8
- VCR.use_cassette :valid_barcode do
9
- parcel = RussianPost::Parcel.new("RD025500807SE")
10
- assert_kind_of Array, parcel.operations
11
- assert_kind_of RussianPost::Operation, parcel.operations[0]
6
+ module RussianPost
7
+ class ParcelTest < MiniTest::Unit::TestCase
8
+ def test_returns_array_of_operations
9
+ VCR.use_cassette :valid_barcode do
10
+ parcel = Parcel.new("RD025500807SE")
11
+ assert_kind_of Array, parcel.operations
12
+ assert_kind_of Operation, parcel.operations[0]
13
+ end
12
14
  end
13
- end
14
15
 
15
- def test_returns_empty_array_on_nonexistent_parcel
16
- VCR.use_cassette("nonexistent_parcel") do
17
- parcel = RussianPost::Parcel.new("RR123456785EE")
18
- assert_kind_of Array, parcel.operations
19
- assert parcel.operations.empty?
16
+ def test_returns_empty_array_on_nonexistent_parcel
17
+ VCR.use_cassette("nonexistent_parcel") do
18
+ parcel = Parcel.new("RR123456785EE")
19
+ assert_kind_of Array, parcel.operations
20
+ assert parcel.operations.empty?
21
+ end
20
22
  end
21
- end
22
23
 
23
- def test_raises_error_on_invalid_barcode
24
- assert_raises RussianPost::InvalidBarcode do
25
- RussianPost::Parcel.new("123")
24
+ def test_raises_error_on_invalid_barcode
25
+ assert_raises InvalidBarcode do
26
+ Parcel.new("123")
27
+ end
26
28
  end
27
29
  end
28
- end
29
30
 
30
- class ParcelMetaTest < MiniTest::Unit::TestCase
31
- attr_reader :parcel
31
+ class ParcelMetaTest < MiniTest::Unit::TestCase
32
+ attr_reader :parcel
32
33
 
33
- def setup
34
- VCR.use_cassette :valid_barcode do
35
- @parcel = RussianPost::Parcel.new("RD025500807SE")
36
- parcel.operations
37
- end
38
- end
34
+ def setup
35
+ VCR.use_cassette :valid_barcode do
36
+ @parcel = Parcel.new("RD025500807SE")
37
+ parcel.operations
38
+ end
39
+ end
39
40
 
40
- def test_knows_current_location
41
- location = RussianPost::Address.new("127576", "Москва 576")
42
- assert_equal location, parcel.location
43
- end
41
+ def test_knows_current_location
42
+ location = Address.new("127576", "Москва 576")
43
+ assert_equal location, parcel.location
44
+ end
44
45
 
45
- def test_knows_parcel_mass
46
- assert_equal 281, parcel.mass
47
- end
46
+ def test_knows_parcel_mass
47
+ assert_equal 281, parcel.mass
48
+ end
48
49
 
49
- def test_knows_type
50
- type = RussianPost::GenericOperationParameter.new(5, "Мелкий пакет")
51
- assert_equal type, parcel.type
52
- end
50
+ def test_knows_type
51
+ type = GenericOperationParameter.new(5, "Мелкий пакет")
52
+ assert_equal type, parcel.type
53
+ end
53
54
 
54
- def test_knows_rank
55
- rank = RussianPost::GenericOperationParameter.new(0, "Без разряда")
56
- assert_equal rank, parcel.rank
57
- end
55
+ def test_knows_rank
56
+ rank = GenericOperationParameter.new(0, "Без разряда")
57
+ assert_equal rank, parcel.rank
58
+ end
58
59
 
59
- def test_knows_recipient
60
- assert_equal "ЕЛЕНА", parcel.recipient
60
+ def test_knows_recipient
61
+ assert_equal "ЕЛЕНА", parcel.recipient
62
+ end
61
63
  end
62
64
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: russianpost
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Artem Shitov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-04-28 00:00:00.000000000 Z
11
+ date: 2013-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler