squeegee 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -1
- data/README.md +3 -3
- data/lib/squeegee/orange_uk.rb +1 -1
- data/lib/squeegee/version.rb +1 -1
- data/spec/squeegee/orange_uk_spec.rb +21 -0
- metadata +3 -3
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
# Squeegee [![CI Build Status](https://secure.travis-ci.org/
|
1
|
+
# Squeegee [![CI Build Status](https://secure.travis-ci.org/kylewelsby/Squeegee.png?branch=master)][travis] [![Dependency Status](https://gemnasium.com/kylewelsby/Squeegee.png?travis)][gemnasium]
|
2
2
|
|
3
|
-
[travis]:http://travis-ci.org/
|
4
|
-
[gemnasium]:https://gemnasium.com/
|
3
|
+
[travis]:http://travis-ci.org/kylewelsby/Squeegee
|
4
|
+
[gemnasium]:https://gemnasium.com/kylewelsby/Squeegee
|
5
5
|
|
6
6
|
Squeegee is a collection of login strategies to gather bill dates and amounts
|
7
7
|
from customer accounts.
|
data/lib/squeegee/orange_uk.rb
CHANGED
@@ -56,7 +56,7 @@ module Squeegee
|
|
56
56
|
balance = page.search("#paymBalanceIncVAT").inner_text.gsub(/\.|,/,'').match(/\d{1,}/)
|
57
57
|
|
58
58
|
due_at = Date.parse(last_bill.search("td")[0].inner_text)
|
59
|
-
amount = last_bill.search('td')[2].inner_text.gsub(/\.|,/,'').match(
|
59
|
+
amount = last_bill.search('td')[2].inner_text.gsub(/\.|,/,'').match(/\-?\d{1,}/)[0].to_i
|
60
60
|
number = page.at("#accountSelectorLilp")['value'].to_i
|
61
61
|
#@paid = balance || balance[0].to_i >= 0
|
62
62
|
uid = Digest::MD5.hexdigest("OrangeUK#{number}")
|
data/lib/squeegee/version.rb
CHANGED
@@ -115,6 +115,27 @@ describe Squeegee::OrangeUK do
|
|
115
115
|
due_at: Date.parse('2012-05-15'))
|
116
116
|
subject.new
|
117
117
|
end
|
118
|
+
|
119
|
+
it "gets a negative number" do
|
120
|
+
mechanize.should_receive(:search).with(
|
121
|
+
"#eBillMainContent .eBillStandardTable"
|
122
|
+
).and_return([node])
|
123
|
+
node.should_receive(:search).with("td").twice.and_return(
|
124
|
+
[
|
125
|
+
stub(:inner_text => "15 May 2012"),
|
126
|
+
{},
|
127
|
+
stub(:inner_text => "£-25.50")
|
128
|
+
]
|
129
|
+
)
|
130
|
+
mechanize.stub(:at).with('#accountSelectorLilp').and_return({'value' => '1234'})
|
131
|
+
Squeegee::Account.should_receive(:new).
|
132
|
+
with(amount: -2550,
|
133
|
+
name: "Orange UK (1234)",
|
134
|
+
uid: "06a0a787d8267fcb1a2887dc7baf4de1",
|
135
|
+
:number => 1234,
|
136
|
+
due_at: Date.parse('2012-05-15'))
|
137
|
+
subject.new
|
138
|
+
end
|
118
139
|
end
|
119
140
|
|
120
141
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: squeegee
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-02-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: mechanize
|
@@ -158,7 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
158
158
|
version: '0'
|
159
159
|
requirements: []
|
160
160
|
rubyforge_project:
|
161
|
-
rubygems_version: 1.8.
|
161
|
+
rubygems_version: 1.8.25
|
162
162
|
signing_key:
|
163
163
|
specification_version: 3
|
164
164
|
summary: Returns bill dates and amounts form utility accounts.
|