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 CHANGED
@@ -4,4 +4,4 @@ source 'https://rubygems.org'
4
4
  gemspec
5
5
 
6
6
  gem 'guard-rspec'
7
- gem "cane", "~> 1.1.0"
7
+ gem "cane"
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
- # Squeegee [![CI Build Status](https://secure.travis-ci.org/BritRuby/Squeegee.png?branch=master)][travis] [![Dependency Status](https://gemnasium.com/BritRuby/Squeegee.png?travis)][gemnasium]
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/BritRuby/Squeegee
4
- [gemnasium]:https://gemnasium.com/BritRuby/Squeegee
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.
@@ -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(/\d{1,}/)[0].to_i
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}")
@@ -1,3 +1,3 @@
1
1
  module Squeegee
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -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.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: 2012-12-17 00:00:00.000000000 Z
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.24
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.