work_calculator 1.0.0 → 1.0.1
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 +4 -4
- data/.rspec +2 -0
- data/.travis.yml +3 -0
- data/Rakefile +4 -0
- data/lib/work_calculator/version.rb +1 -1
- data/spec/spec_helper.rb +2 -0
- data/spec/work_calculator_spec.rb +42 -0
- data/work_calculator.gemspec +1 -0
- metadata +22 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dae2b7d2223c1b23bdb0c7a5b4c533ec1118099d
|
4
|
+
data.tar.gz: 76439686cacec88bf69e81cebafd3521d26432da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7075b9535ae94058495d7979320edca60acbaa7fd0c62f550ff93283cf3b94cda391c70d61bb1c7384cc6d8885bf298c991086848be01d8064a5f618d6c30d2
|
7
|
+
data.tar.gz: a73777c00ba7717bb6b2c46766a22cfe1958a37ed0c22c9be49a7af94442ad58cd9b1d7af22d1edff9399fcf688176d2420698d75638eb7503cff27b89803401
|
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Rakefile
CHANGED
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe WorkCalculator do
|
4
|
+
subject { [calculator] }
|
5
|
+
|
6
|
+
describe "#get_elapsed_days" do
|
7
|
+
let(:calculator) { WorkCalculator.new }
|
8
|
+
|
9
|
+
dates = [
|
10
|
+
{
|
11
|
+
start: '01/01/2000',
|
12
|
+
finish: '03/01/2000',
|
13
|
+
expected: 1
|
14
|
+
},
|
15
|
+
{
|
16
|
+
start: '02/06/1983',
|
17
|
+
finish: '22/06/1983',
|
18
|
+
expected: 19
|
19
|
+
},
|
20
|
+
{
|
21
|
+
start: '04/07/1984',
|
22
|
+
finish: '25/12/1984',
|
23
|
+
expected: 173
|
24
|
+
},
|
25
|
+
{
|
26
|
+
start: '03/01/1989',
|
27
|
+
finish: '03/08/1983',
|
28
|
+
expected: 1979
|
29
|
+
}
|
30
|
+
]
|
31
|
+
|
32
|
+
dates.each do |test|
|
33
|
+
describe "when elapsed days worked is set from #{test[:start]} to #{test[:finish]}" do
|
34
|
+
let(:calculator) { WorkCalculator.new(test[:start], test[:finish]) }
|
35
|
+
|
36
|
+
it "should return #{test[:expected]}" do
|
37
|
+
expect(calculator.get_elapsed_days).to eq(test[:expected])
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
data/work_calculator.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: work_calculator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- den10
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
41
55
|
description: CLI work calculator
|
42
56
|
email:
|
43
57
|
- tang.graphics@gmail.com
|
@@ -47,6 +61,8 @@ extensions: []
|
|
47
61
|
extra_rdoc_files: []
|
48
62
|
files:
|
49
63
|
- ".gitignore"
|
64
|
+
- ".rspec"
|
65
|
+
- ".travis.yml"
|
50
66
|
- Gemfile
|
51
67
|
- LICENSE.txt
|
52
68
|
- README.md
|
@@ -54,6 +70,8 @@ files:
|
|
54
70
|
- bin/work_calculator
|
55
71
|
- lib/work_calculator.rb
|
56
72
|
- lib/work_calculator/version.rb
|
73
|
+
- spec/spec_helper.rb
|
74
|
+
- spec/work_calculator_spec.rb
|
57
75
|
- work_calculator.gemspec
|
58
76
|
homepage: ''
|
59
77
|
licenses:
|
@@ -79,4 +97,6 @@ rubygems_version: 2.2.2
|
|
79
97
|
signing_key:
|
80
98
|
specification_version: 4
|
81
99
|
summary: Dead simple calculator
|
82
|
-
test_files:
|
100
|
+
test_files:
|
101
|
+
- spec/spec_helper.rb
|
102
|
+
- spec/work_calculator_spec.rb
|