aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2017-05-26 13:27:44 +0200
committerRobert2017-05-29 08:49:52 +0200
commit52d2c968cac7e901b8e6fa3d1be115239b7c5937 (patch)
tree12e98e66c26c22c4ef32e3d255a7fda0d0a0b0de
parent993658e22504f0d566710296eb29d03baec3a2ee (diff)
downloadchouette-core-52d2c968cac7e901b8e6fa3d1be115239b7c5937.tar.bz2
time_duration_spec.rb: Make old test style uniform with new tests
Change the variable names to `earlier` and `later`, and use explicit `true` and `false` values to be consistent with the newer tests in this file. The new variable names in particular should be a little quicker to understand. Refs #870
-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