summaryrefslogtreecommitdiff
path: root/spec/ruby/core/time
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/time')
-rw-r--r--spec/ruby/core/time/yday_spec.rb13
1 files changed, 2 insertions, 11 deletions
diff --git a/spec/ruby/core/time/yday_spec.rb b/spec/ruby/core/time/yday_spec.rb
index 6ea5ff8f1b..e920c2e28d 100644
--- a/spec/ruby/core/time/yday_spec.rb
+++ b/spec/ruby/core/time/yday_spec.rb
@@ -1,4 +1,5 @@
require_relative '../../spec_helper'
+require_relative '../../shared/time/yday'
describe "Time#yday" do
it "returns an integer representing the day of the year, 1..366" do
@@ -7,15 +8,5 @@ describe "Time#yday" do
end
end
- it 'returns the correct value for each day of each month' do
- mdays = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
-
- yday = 1
- mdays.each_with_index do |days, month|
- days.times do |day|
- Time.new(2014, month+1, day+1).yday.should == yday
- yday += 1
- end
- end
- end
+ it_behaves_like :time_yday, -> year, month, day { Time.new(year, month, day).yday }
end