westpac_com_au 0.6.0 → 0.6.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6c802d540cdab07de0bf66b0f599529a88b3b1e33089f78d0fbc05d505c3e32d
4
- data.tar.gz: 1c30e9a6f93983fc4f66de84e58643f2e5c1ab3e9d9b5d86116dbb198ac75a05
3
+ metadata.gz: cb98ae0a5025296b5fe5a9762c293f090368e7ee1975e8257cd72fe3f0da379c
4
+ data.tar.gz: 7e9ab839fc81c08cfa1d019e811a3f426e19f3b8d2a8b218f2faef96e8450511
5
5
  SHA512:
6
- metadata.gz: 379229a73a35a6d5f5cfa01daca3830db0fed959aa31c013e57c44e91e64f8948e89d7637ee89012220534a33506492b60636fb5680708eb9167ae4c394103d2
7
- data.tar.gz: 686dfc31312f391deed97a193dbfb35824826daa7527c57ee374ebd6cc87c44fe0bc8fa2097ab00197039b42112b17e250b3f570ecf00cb382f3b3611b15bdae
6
+ metadata.gz: 43f2bf355a71eb74130e3a5c7bd33b49ce6a42736e41e4738e249fc91f366848764bdb7d44458ceb98879f37ad2c2153210c60a36b4948322baab3e98dda9836
7
+ data.tar.gz: 53668e5ab6b8f7c4b919d2d191cbd759357bf7fbbbe5032000ecb3976cf4d9373569ce53fb8cf8b3b85f3d3ba2b07fceecd6b23e3a5b476d34473ddd10a93d76
data/CHANGELOG CHANGED
@@ -1,7 +1,25 @@
1
- # CHANGELOG
1
+ # westpac_com_au/CHANGELOG
2
2
 
3
3
  ## 20261116
4
4
 
5
+ 0.6.2: The tests share a helper, and VERSION and the gemspec are tested; the gemspec links to the repository.
6
+
7
+ 1. + test/helper.rb
8
+ 2. ~ test/WestpacComAu/Account_test.rb: Requires the helper.
9
+ 3. ~ test/WestpacComAu/Transactions_test.rb: Requires the helper.
10
+ 4. + test/VERSION_test.rb
11
+ 5. + test/gemspec_test.rb
12
+ 6. ~ westpac_com_au.gemspec: A header line naming it, and metadata linking the repository's issues, CHANGELOG, source and README.
13
+ 7. ~ CHANGELOG: /# CHANGELOG/# westpac_com_au\/CHANGELOG/
14
+ 8. ~ WestpacComAu::VERSION: /0.6.1/0.6.2/
15
+
16
+ 0.6.1: - WestpacComAu::Account#login, #validate_args: Now uses superclass WebAccount.
17
+
18
+ 1. ~ westpac_com_au.gemspec: webaccount /'~> 0.9'/'~> 0.10'/
19
+ 2. - WestpacComAu::Account#login, WebAccount 0.10.0's naming every missing value at once.
20
+ 3. - WestpacComAu::Account#validate_args, WebAccount 0.10.0's being inherited.
21
+ 4. ~ WestpacComAu::VERSION: /0.6.0/0.6.1/
22
+
5
23
  0.6.0: Ready for publishing.
6
24
 
7
25
  1. + westpac_com_au.gemspec
@@ -35,11 +35,6 @@ module WestpacComAu
35
35
  export_button: {css: 'button.export-link'}
36
36
  }
37
37
 
38
- def login(username: nil, password: nil)
39
- validate_args(username: username || self.username, password: password || self.password)
40
- super
41
- end
42
-
43
38
  # period is :all, the last year, or :last_month. Without it, from_date and to_date, which default to a year ago and today. Returns the name of the CSV file downloaded.
44
39
  def download_transactions(account_number:, period: nil, from_date: nil, to_date: nil)
45
40
  from_date, to_date = dates(period: period, from_date: from_date, to_date: to_date)
@@ -52,17 +47,6 @@ module WestpacComAu
52
47
 
53
48
  private
54
49
 
55
- def validate_args(args)
56
- missing_args = []
57
- args.each do |arg_name, value|
58
- missing_args << arg_name unless value
59
- end
60
- return if missing_args.empty?
61
- aggregate_error = missing_args.join(', ')
62
- copula = missing_args.count > 1 ? 'are' : 'is'
63
- raise ArgumentError, "#{aggregate_error} #{copula} missing."
64
- end
65
-
66
50
  # cookie notice
67
51
 
68
52
  # Didomi draws its notice once the page has loaded, so it's waited for briefly. Where the choice is remembered, as in a profile kept between runs, there's none.
@@ -2,5 +2,5 @@
2
2
  # WestpacComAu::VERSION
3
3
 
4
4
  module WestpacComAu
5
- VERSION = '0.6.0'
5
+ VERSION = '0.6.2'
6
6
  end
@@ -0,0 +1,20 @@
1
+ # test/VERSION_test.rb
2
+
3
+ require_relative './helper'
4
+
5
+ describe WestpacComAu do
6
+ describe "VERSION" do
7
+ it "is a string" do
8
+ _(WestpacComAu::VERSION).must_be_instance_of String
9
+ end
10
+
11
+ it "is three numbers separated by dots" do
12
+ _(WestpacComAu::VERSION).must_match(/\A\d+\.\d+\.\d+\z/)
13
+ end
14
+
15
+ it "matches the newest entry in the CHANGELOG" do
16
+ changelog = File.read(File.expand_path('../CHANGELOG', __dir__))
17
+ _(changelog[/^(\d+\.\d+\.\d+):/, 1]).must_equal(WestpacComAu::VERSION)
18
+ end
19
+ end
20
+ end
@@ -3,11 +3,9 @@
3
3
  # Notes:
4
4
  # 1. No browser and no Westpac: only what doesn't depend on the site is tested. Every account which might reach for its browser is given a stand-in, so as none is started.
5
5
 
6
- require_relative '../../lib/westpac_com_au'
6
+ require_relative '../helper'
7
7
 
8
8
  require 'date'
9
- require 'minitest/autorun'
10
- require 'minitest-spec-context'
11
9
 
12
10
  describe WestpacComAu::Account do
13
11
  def stand_in_element(displayed: true)
@@ -3,10 +3,7 @@
3
3
  # Notes:
4
4
  # 1. WestpacComAu::Account.new is swapped for a stand-in for the length of each example and put back afterwards, so as no browser is started.
5
5
 
6
- require_relative '../../lib/westpac_com_au'
7
-
8
- require 'minitest/autorun'
9
- require 'minitest-spec-context'
6
+ require_relative '../helper'
10
7
 
11
8
  describe WestpacComAu::Transactions do
12
9
  def with_stand_in_account(download: ->{'/downloads/transactions.csv'})
@@ -0,0 +1,37 @@
1
+ # test/gemspec_test.rb
2
+
3
+ require_relative './helper'
4
+
5
+ describe 'westpac_com_au.gemspec' do
6
+ let(:spec){Gem::Specification.load(File.expand_path('../westpac_com_au.gemspec', __dir__))}
7
+
8
+ it "is a valid specification" do
9
+ _(spec.validate).must_equal(true)
10
+ end
11
+
12
+ it "is named westpac_com_au" do
13
+ _(spec.name).must_equal('westpac_com_au')
14
+ end
15
+
16
+ it "does not pin a date" do
17
+ _(spec.date).must_equal(Gem::Specification.new.date)
18
+ end
19
+
20
+ it "takes its version from WestpacComAu::VERSION" do
21
+ _(spec.version.to_s).must_equal(WestpacComAu::VERSION)
22
+ end
23
+
24
+ it "declares its runtime dependencies" do
25
+ _(spec.runtime_dependencies.map(&:name).sort).must_equal(%w{selenium-webdriver webaccount})
26
+ end
27
+
28
+ it "ships the gemspec which names it" do
29
+ _(spec.files).must_include('westpac_com_au.gemspec')
30
+ end
31
+
32
+ it "links the homepage and each metadata link to the repository" do
33
+ links = [spec.homepage] + spec.metadata.values
34
+ _(spec.metadata.keys.sort).must_equal(%w{bug_tracker_uri changelog_uri documentation_uri source_code_uri})
35
+ links.each{|link| _(link).must_match(%r{\Ahttps://github\.com/thoran/westpac_com_au(/|\z)})}
36
+ end
37
+ end
data/test/helper.rb ADDED
@@ -0,0 +1,8 @@
1
+ # test/helper.rb
2
+
3
+ require 'minitest/autorun'
4
+ require 'minitest/spec'
5
+ require 'minitest-spec-context'
6
+
7
+ $LOAD_PATH.unshift(File.expand_path('../lib', __dir__))
8
+ require 'westpac_com_au'
@@ -1,3 +1,5 @@
1
+ # westpac_com_au.gemspec
2
+
1
3
  require_relative './lib/WestpacComAu/VERSION'
2
4
 
3
5
  class Gem::Specification
@@ -22,6 +24,13 @@ Gem::Specification.new do |spec|
22
24
  spec.homepage = 'https://github.com/thoran/westpac_com_au'
23
25
  spec.license = 'MIT'
24
26
 
27
+ spec.metadata = {
28
+ 'bug_tracker_uri' => 'https://github.com/thoran/westpac_com_au/issues',
29
+ 'changelog_uri' => 'https://github.com/thoran/westpac_com_au/blob/master/CHANGELOG',
30
+ 'source_code_uri' => 'https://github.com/thoran/westpac_com_au',
31
+ 'documentation_uri' => 'https://github.com/thoran/westpac_com_au/blob/master/README.md',
32
+ }
33
+
25
34
  spec.require_paths = ['lib']
26
35
  spec.required_ruby_version = '>= 3.3'
27
36
 
@@ -38,7 +47,7 @@ Gem::Specification.new do |spec|
38
47
 
39
48
  spec.dependencies = [
40
49
  ['selenium-webdriver', '>= 4.0'],
41
- ['webaccount', '~> 0.9']
50
+ ['webaccount', '~> 0.10']
42
51
  ]
43
52
 
44
53
  spec.development_dependencies = %w{
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: westpac_com_au
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - thoran
@@ -29,14 +29,14 @@ dependencies:
29
29
  requirements:
30
30
  - - "~>"
31
31
  - !ruby/object:Gem::Version
32
- version: '0.9'
32
+ version: '0.10'
33
33
  type: :runtime
34
34
  prerelease: false
35
35
  version_requirements: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: '0.9'
39
+ version: '0.10'
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: minitest
42
42
  requirement: !ruby/object:Gem::Requirement
@@ -95,13 +95,20 @@ files:
95
95
  - lib/WestpacComAu/Transactions.rb
96
96
  - lib/WestpacComAu/VERSION.rb
97
97
  - lib/westpac_com_au.rb
98
+ - test/VERSION_test.rb
98
99
  - test/WestpacComAu/Account_test.rb
99
100
  - test/WestpacComAu/Transactions_test.rb
101
+ - test/gemspec_test.rb
102
+ - test/helper.rb
100
103
  - westpac_com_au.gemspec
101
104
  homepage: https://github.com/thoran/westpac_com_au
102
105
  licenses:
103
106
  - MIT
104
- metadata: {}
107
+ metadata:
108
+ bug_tracker_uri: https://github.com/thoran/westpac_com_au/issues
109
+ changelog_uri: https://github.com/thoran/westpac_com_au/blob/master/CHANGELOG
110
+ source_code_uri: https://github.com/thoran/westpac_com_au
111
+ documentation_uri: https://github.com/thoran/westpac_com_au/blob/master/README.md
105
112
  rdoc_options: []
106
113
  require_paths:
107
114
  - lib