aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2017-05-31 18:15:10 +0200
committerTeddy Wing2017-05-31 18:15:10 +0200
commit04e70325040d7178a18bb126c4f7e36103c04fd9 (patch)
treebfee58fcbdca35e384a39a562bf536b7d7e2a27a
parentcdc3a394465c6041e0778023078e802a60abc6cd (diff)
downloadchouette-core-04e70325040d7178a18bb126c4f7e36103c04fd9.tar.bz2
Revert "Revert "time_duration_spec.rb: Make old test style uniform with new tests""
This reverts commit b0e6bc3ffd02146fd999f12975f269dac94a0994. Reinstate the updated `TimeDuration` spec code. Seems like this was reverted by accident. Robert was doing a complicated merge/rebase and somehow in the mix this commit ended up being unintentionally reverted. > 16:23:26 +0200 < robert> @teddy merge idiosynchrasy I did not touch these specs deliberately but must have pulled in the old version by error sorry > 16:24:19 +0200 < robert> I had some strange conflicts and rebased twice, hmmm, strange though I just did not touch these specs for months > ... > 16:25:10 +0200 < robert> anywyay feelfree to undo my undoing :blush:
-rw-r--r--spec/lib/time_duration_spec.rb14
1 files changed, 8 insertions, 6 deletions
diff --git a/spec/lib/time_duration_spec.rb b/spec/lib/time_duration_spec.rb
index 1cba1f6d5..bf23f7ba6 100644
--- a/spec/lib/time_duration_spec.rb
+++ b/spec/lib/time_duration_spec.rb
@@ -4,15 +4,17 @@ describe TimeDuration do
describe ".exceeds_gap?" do
context "when duration is 4.hours" do
it "should return false if gap < 1.hour" do
- t1 = Time.now
- t2 = Time.now + 3.minutes
- expect(TimeDuration.exceeds_gap?(4.hours, t1, t2)).to be_falsey
+ earlier = Time.now
+ later = Time.now + 3.minutes
+
+ expect(TimeDuration.exceeds_gap?(4.hours, earlier, later)).to be false
end
it "should return true if gap > 4.hour" do
- t1 = Time.now
- t2 = Time.now + (4.hours + 1.minutes)
- expect(TimeDuration.exceeds_gap?(4.hours, t1, t2)).to be_truthy
+ earlier = Time.now
+ later = Time.now + (4.hours + 1.minutes)
+
+ expect(TimeDuration.exceeds_gap?(4.hours, earlier, later)).to be true
end
it "returns true when `earlier` is later than `later`" do