From 159435d8c18f304f352b81a20de8f33066c35943 Mon Sep 17 00:00:00 2001 From: Herwin Date: Wed, 25 Sep 2024 11:37:44 +0200 Subject: [PATCH 1/2] Refresh specs for Date#month This has been rewritten to a shared spec --- spec/library/date/month_spec.rb | 6 ++---- spec/library/date/shared/month.rb | 6 ++++++ 2 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 spec/library/date/shared/month.rb diff --git a/spec/library/date/month_spec.rb b/spec/library/date/month_spec.rb index e040f9a94..f493ec811 100644 --- a/spec/library/date/month_spec.rb +++ b/spec/library/date/month_spec.rb @@ -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 diff --git a/spec/library/date/shared/month.rb b/spec/library/date/shared/month.rb new file mode 100644 index 000000000..5fcb2cbeb --- /dev/null +++ b/spec/library/date/shared/month.rb @@ -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 From 8080b7c245040e504af00cdb9e6a294739216d95 Mon Sep 17 00:00:00 2001 From: Herwin Date: Wed, 25 Sep 2024 11:38:29 +0200 Subject: [PATCH 2/2] Import specs for Date#mon --- spec/library/date/mon_spec.rb | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 spec/library/date/mon_spec.rb diff --git a/spec/library/date/mon_spec.rb b/spec/library/date/mon_spec.rb new file mode 100644 index 000000000..616d72cf8 --- /dev/null +++ b/spec/library/date/mon_spec.rb @@ -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