Skip to content

Commit

Permalink
Merge pull request #2238 from herwinw/spec_date_mon
Browse files Browse the repository at this point in the history
Refresh specs for Date#month and Date#mon
  • Loading branch information
herwinw committed Sep 25, 2024
2 parents 0ee5a76 + 8080b7c commit 9496445
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
7 changes: 7 additions & 0 deletions spec/library/date/mon_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require_relative '../../spec_helper'
require_relative 'shared/month'
require 'date'

describe "Date#mon" do
it_behaves_like :date_month, :mon
end
6 changes: 2 additions & 4 deletions spec/library/date/month_spec.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
require_relative '../../spec_helper'
require_relative 'shared/month'
require 'date'

describe "Date#month" do
it "returns the month" do
m = Date.new(2000, 7, 1).month
m.should == 7
end
it_behaves_like :date_month, :month
end
6 changes: 6 additions & 0 deletions spec/library/date/shared/month.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
describe :date_month, shared: true do
it "returns the month" do
m = Date.new(2000, 7, 1).send(@method)
m.should == 7
end
end

0 comments on commit 9496445

Please sign in to comment.