time_frame 0.4.2 → 0.4.3
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/lib/time_frame/time_frame.rb +6 -0
- data/lib/time_frame/version.rb +1 -1
- data/spec/time_frame_spec.rb +12 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 16119ae2815aedbad4ad320c8e31c4bf7c1d9389
|
4
|
+
data.tar.gz: 93f06cafdda61db5d3ab2b68ce126307c1f9bbf9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 124139bd01a35c6e7e9ae9ca22aa4c042bcc0b3df0880ba2814bfe57eef074a55766515bd31ca2e4b5bc660a60400ac2e35af492bab8347e7b5efe589f7f4b1f
|
7
|
+
data.tar.gz: 906d7abb6482845a0fd455e43520cbf79b6b8951ab12e7590f8b8bdb91cb960403fc90ec94181afa326245447170ec9dea5dad29e709ff55f963bd443b313bf4
|
data/lib/time_frame/version.rb
CHANGED
data/spec/time_frame_spec.rb
CHANGED
@@ -10,6 +10,18 @@ describe TimeFrame do
|
|
10
10
|
I18n.enforce_available_locales = true
|
11
11
|
end
|
12
12
|
|
13
|
+
it "should be hashable" do
|
14
|
+
hash = {}
|
15
|
+
time_frame1 = TimeFrame.new(min: time, duration: duration)
|
16
|
+
time_frame2 = TimeFrame.new(min: time, duration: duration)
|
17
|
+
time_frame3 = TimeFrame.new(min: time, duration: duration / 2)
|
18
|
+
time_frame4 = TimeFrame.new(min: time - duration / 2 , max: time + duration)
|
19
|
+
hash[time_frame1] = 1
|
20
|
+
expect(hash[time_frame2]).to eq 1
|
21
|
+
expect(hash[time_frame3]).not_to eq 1
|
22
|
+
expect(hash[time_frame4]).not_to eq 1
|
23
|
+
end
|
24
|
+
|
13
25
|
describe '#min and #max' do
|
14
26
|
context 'when given two times' do
|
15
27
|
context 'and min is smaller than max' do
|