Skip to content

Commit

Permalink
Use during in favor of on in docstrings
Browse files Browse the repository at this point in the history
This wording is a bit richer and provides more context with respect to
the `on_*?` methods.
  • Loading branch information
craiglittle committed Jun 13, 2016
1 parent 270859e commit 3487cf9
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 22 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ Biz.within(Time.utc(2015, 3, 7), Time.utc(2015, 3, 14)).in_seconds
# Determine if a time is in business hours
Biz.in_hours?(Time.utc(2015, 1, 10, 9))

# Determine if a time is on a break
# Determine if a time is during a break
Biz.on_break?(Time.utc(2016, 6, 3))

# Determine if a time is on a holiday
# Determine if a time is during a holiday
Biz.on_holiday?(Time.utc(2014, 1, 1))
```

Expand Down
12 changes: 6 additions & 6 deletions spec/calculation/active_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,23 @@

describe '#result' do
context 'when the time is not contained by an interval' do
context 'and not on a break nor holiday' do
context 'and not during a break nor holiday' do
let(:time) { Time.utc(2006, 1, 1, 6) }

it 'returns false' do
expect(calculation.result).to eq false
end
end

context 'and on a break' do
context 'and during a break' do
let(:time) { Time.utc(2006, 1, 3, 6) }

it 'returns false' do
expect(calculation.result).to eq false
end
end

context 'and on a holiday' do
context 'and during a holiday' do
let(:time) { Time.utc(2006, 1, 4, 6) }

it 'returns false' do
Expand All @@ -37,23 +37,23 @@
end

context 'when the time is contained by an interval' do
context 'and not on a break nor holiday' do
context 'and not during a break nor holiday' do
let(:time) { Time.utc(2006, 1, 2, 12) }

it 'returns true' do
expect(calculation.result).to eq true
end
end

context 'and on a break' do
context 'and during a break' do
let(:time) { Time.utc(2006, 1, 3, 10) }

it 'returns false' do
expect(calculation.result).to eq false
end
end

context 'and on a holiday' do
context 'and during a holiday' do
let(:time) { Time.utc(2006, 1, 4, 12) }

it 'returns false' do
Expand Down
2 changes: 1 addition & 1 deletion spec/calculation/on_break_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
end
end

context 'when the time is not on a break' do
context 'when the time is not during a break' do
let(:time) { Time.utc(2006, 1, 5, 12) }

it 'returns false' do
Expand Down
2 changes: 1 addition & 1 deletion spec/calculation/on_holiday_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
end
end

context 'when the time is not on a holiday' do
context 'when the time is not during a holiday' do
let(:time) { Time.utc(2006, 1, 5, 12) }

it 'returns false' do
Expand Down
8 changes: 4 additions & 4 deletions spec/core_ext/time_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@
end

describe '#on_break?' do
context 'when the time is on a break' do
context 'when the time is during a break' do
let(:time) { time_class.utc(2006, 1, 2, 11) }

it 'returns true' do
expect(time.on_break?).to eq true
end
end

context 'when the time is not on a break' do
context 'when the time is not during a break' do
let(:time) { time_class.utc(2006, 1, 2, 13) }

it 'returns false' do
Expand All @@ -51,15 +51,15 @@
end

describe '#on_holiday?' do
context 'when the time is on a holiday' do
context 'when the time is during a holiday' do
let(:time) { time_class.utc(2006, 1, 1, 12) }

it 'returns true' do
expect(time.on_holiday?).to eq true
end
end

context 'when the time is not on a holiday' do
context 'when the time is not during a holiday' do
let(:time) { time_class.utc(2006, 1, 2, 12) }

it 'returns false' do
Expand Down
4 changes: 2 additions & 2 deletions spec/periods/after_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@
end
end

context 'when a period on a holiday is encountered' do
context 'when a period during a holiday is encountered' do
let(:origin) { Time.utc(2006, 1, 14) }

it 'does not include that period' do
Expand All @@ -285,7 +285,7 @@
end
end

context 'when multiple periods on holidays are encountered' do
context 'when multiple periods during holidays are encountered' do
let(:origin) { Time.utc(2006, 1, 14) }

it 'does not include any of those periods' do
Expand Down
4 changes: 2 additions & 2 deletions spec/periods/before_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@
end
end

context 'when a period on a holiday is encountered' do
context 'when a period during a holiday is encountered' do
let(:origin) { Time.utc(2006, 1, 18) }

it 'does not include that period' do
Expand All @@ -285,7 +285,7 @@
end
end

context 'when multiple periods on holidays are encountered' do
context 'when multiple periods during holidays are encountered' do
let(:origin) { Time.utc(2006, 1, 20) }

it 'does not include any of those periods' do
Expand Down
8 changes: 4 additions & 4 deletions spec/schedule_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,15 @@
end

describe '#on_break?' do
context 'when the time is on a break' do
context 'when the time is during a break' do
let(:time) { Time.utc(2006, 1, 2, 11) }

it 'returns true' do
expect(schedule.on_break?(time)).to eq true
end
end

context 'when the time is not on a break' do
context 'when the time is not during a break' do
let(:time) { Time.utc(2006, 1, 2, 13) }

it 'returns false' do
Expand All @@ -149,15 +149,15 @@
end

describe '#on_holiday?' do
context 'when the time is on a holiday' do
context 'when the time is during a holiday' do
let(:time) { Time.utc(2006, 12, 25, 12) }

it 'returns true' do
expect(schedule.on_holiday?(time)).to eq true
end
end

context 'when the time is not on a holiday' do
context 'when the time is not during a holiday' do
let(:time) { Time.utc(2006, 12, 26, 12) }

it 'returns false' do
Expand Down

0 comments on commit 3487cf9

Please sign in to comment.