diff options
author | Andrew Konchin <[email protected]> | 2024-07-01 15:38:25 +0300 |
---|---|---|
committer | Benoit Daloze <[email protected]> | 2024-07-02 13:33:48 +0200 |
commit | cee62c6738c42ce774e96e180cf2d46afb8e9cbe (patch) | |
tree | 52a37ef94e90f99f8471dbba4d6659ca5dc6c532 /spec/ruby/core/time | |
parent | d7af8afe1b85b8de04cd77c673b0f6ef3f3627fa (diff) |
Update to ruby/spec@f8987ac
Diffstat (limited to 'spec/ruby/core/time')
-rw-r--r-- | spec/ruby/core/time/yday_spec.rb | 13 |
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 |