apple_warranty_check 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/apple_warranty_check.gemspec +2 -1
- data/bin/console +2 -2
- data/lib/apple_warranty_check/version.rb +1 -1
- data/spec/apple_warranty_check_spec.rb +18 -1
- metadata +18 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2c251102b73c129aa36d59535824721ac8ba1f66
|
4
|
+
data.tar.gz: 156b48d8e486e07520c6300c90bf9c2b0d80e604
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1add8a3b5801ffcc9ada47185c19aa37f1cbaa98f3f1fc0fa1ffdab7f4c26fd5c0e383589615a229918f07d53910f54a842344394fb9848c6c97e93cd3db83f5
|
7
|
+
data.tar.gz: e3a12e17c19b53718cc6a8f07ec54822fcb52e2012ec6b2e3327b9891aced6d32a33a7d1eaab14e32505690cebf4e4fd3df1fa44dab43014a506cd47bbc35c04
|
data/README.md
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
[![Code Climate](https://codeclimate.com/github/flowerett/apple_warranty_check/badges/gpa.svg)](https://codeclimate.com/github/flowerett/apple_warranty_check)
|
6
6
|
[![Dependency Status](https://gemnasium.com/flowerett/apple_warranty_check.svg)](https://gemnasium.com/flowerett/apple_warranty_check)
|
7
7
|
|
8
|
-
Simple tool to get warranty info for Apple devices by it's IMEI.
|
8
|
+
Simple tool to get warranty info for Apple devices by it's IMEI from official site.
|
9
9
|
|
10
10
|
## Installation
|
11
11
|
|
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.email = ["nick.chernyshev@gmail.com"]
|
10
10
|
|
11
11
|
spec.summary = 'Check Apple warranty by IMEI'
|
12
|
-
spec.description =
|
12
|
+
spec.description = "Simple tool to get warranty info for Apple devices by it's IMEI from official site."
|
13
13
|
spec.homepage = "https://github.com/flowerett/apple_warranty_check"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
@@ -21,4 +21,5 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.add_development_dependency "bundler", "~> 1.10"
|
22
22
|
spec.add_development_dependency "rake", "~> 10.0"
|
23
23
|
spec.add_development_dependency "rspec", "~> 3.3.0"
|
24
|
+
spec.add_development_dependency "pry"
|
24
25
|
end
|
data/bin/console
CHANGED
@@ -2,7 +2,7 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe AppleWarrantyCheck do
|
4
4
|
it 'has a version number' do
|
5
|
-
expect(AppleWarrantyCheck::VERSION).to eq '0.0.
|
5
|
+
expect(AppleWarrantyCheck::VERSION).to eq '0.0.5'
|
6
6
|
end
|
7
7
|
|
8
8
|
let(:valid_warranty_html) { File.open('spec/files/valid_warranty_resp.html').read }
|
@@ -11,6 +11,23 @@ describe AppleWarrantyCheck do
|
|
11
11
|
|
12
12
|
let(:pr) { AppleWarrantyCheck::Process.new() }
|
13
13
|
|
14
|
+
describe '#run' do
|
15
|
+
it 'returns active result from apple site' do
|
16
|
+
info = AppleWarrantyCheck::Process.new('013977000323877').run
|
17
|
+
|
18
|
+
expect(info[:product_info][:APIMEINum]).to eq "013977000323877"
|
19
|
+
expect(info[:hw_support][:support_status]).to eq 'Active'
|
20
|
+
expect(info[:hw_support][:expiration_date]).to eq "August 10, 2016"
|
21
|
+
end
|
22
|
+
|
23
|
+
it 'returns expired result from apple site' do
|
24
|
+
info = AppleWarrantyCheck::Process.new('013896000639712').run
|
25
|
+
|
26
|
+
expect(info[:product_info][:APIMEINum]).to eq "013896000639712"
|
27
|
+
expect(info[:hw_support][:support_status]).to eq 'Expired'
|
28
|
+
expect(info[:hw_support][:expiration_date]).to be_nil
|
29
|
+
end
|
30
|
+
end
|
14
31
|
|
15
32
|
describe '#parse_body' do
|
16
33
|
it 'returns error message from invalid html response' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apple_warranty_check
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Chernyshev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-06-
|
11
|
+
date: 2015-06-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -52,7 +52,22 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 3.3.0
|
55
|
-
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: pry
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
description: Simple tool to get warranty info for Apple devices by it's IMEI from
|
70
|
+
official site.
|
56
71
|
email:
|
57
72
|
- nick.chernyshev@gmail.com
|
58
73
|
executables:
|