--- /dev/null
+source 'https://rubygems.org'
+
+gem 'inifile'
+gem 'pg'
+gem 'rspec'
+gem 'tconn'
--- /dev/null
+GEM
+ remote: https://rubygems.org/
+ specs:
+ diff-lcs (1.3)
+ inifile (3.0.0)
+ pg (1.1.4)
+ rspec (3.8.0)
+ rspec-core (~> 3.8.0)
+ rspec-expectations (~> 3.8.0)
+ rspec-mocks (~> 3.8.0)
+ rspec-core (3.8.2)
+ rspec-support (~> 3.8.0)
+ rspec-expectations (3.8.4)
+ diff-lcs (>= 1.2.0, < 2.0)
+ rspec-support (~> 3.8.0)
+ rspec-mocks (3.8.1)
+ diff-lcs (>= 1.2.0, < 2.0)
+ rspec-support (~> 3.8.0)
+ rspec-support (3.8.2)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ inifile
+ pg
+ rspec
+
+BUNDLED WITH
+ 2.0.2
require 'fileutils'
require 'inifile'
require 'pg'
-require 'tconn'
+require_relative 'tconn'
-require 'series'
+require_relative 'series'
class Store
def unclassified_csv
+++ /dev/null
-
-require 'minitest/autorun'
-require 'store'
-
-class StoreTest < MiniTest::Test
- def test_construct_efs_path
- data = [ [ 1234, '00/00/00/12', '0000001234.dat'],
- [ 1, '00/00/00/00', '0000000001.dat'],
- [1234567890, '12/34/56/78', '1234567890.dat'],
- [ 7778123, '00/07/77/81', '0007778123.dat'],
- [ 0x1b, '00/00/00/00', '0000000027.dat'] ]
-
- store = Store.new()
-
- for (input, expectedPath, expectedName) in data
- (actualPath, actualName) = store.construct_efs_path(input)
- assert_equal(expectedPath, actualPath)
- assert_equal(expectedName, actualName)
- end
- end
-end
--- /dev/null
+
+require 'rspec/autorun'
+require_relative '../store'
+
+describe Store do
+ it "construct_efs_path produces paths and filenames as expected" do
+ data = [
+ [ 1234, '00/00/00/12', '0000001234.dat'],
+ [ 1, '00/00/00/00', '0000000001.dat'],
+ [1234567890, '12/34/56/78', '1234567890.dat'],
+ [ 7778123, '00/07/77/81', '0007778123.dat'],
+ [ 0x1b, '00/00/00/00', '0000000027.dat']
+ ]
+
+ store = Store.new('quanlib.ini')
+
+ data.each do |input, expectedPath, expectedName|
+ (actualPath, actualName) = store.construct_efs_path(input)
+
+ expect(actualPath).to eq(expectedPath)
+ expect(actualName).to eq(expectedName)
+ end
+ end
+end