Skip to content

Commit

Permalink
Merge pull request #1195 from herwinw/date_mon
Browse files Browse the repository at this point in the history
Add specs for Date#mon
  • Loading branch information
andrykonchin authored Sep 25, 2024
2 parents 9341c0a + 97f84c7 commit c62f4a9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion library/date/mon_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require_relative '../../spec_helper'
require_relative 'shared/month'
require 'date'

describe "Date#mon" do
it "needs to be reviewed for spec completeness"
it_behaves_like :date_month, :mon
end
6 changes: 2 additions & 4 deletions 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 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 c62f4a9

Please sign in to comment.