-
-
Notifications
You must be signed in to change notification settings - Fork 390
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This includes some additional updates: * Move old specs for refined_class to a shared spec, use this shared spec for target * Add a spec for Ruby 3.3 to check that refinement_target has been deprecated * Add a spec for Ruby 3.4 to check that refinement_target has been removed
- Loading branch information
1 parent
caa743e
commit 11d86bd
Showing
3 changed files
with
45 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
describe :refinement_target, shared: true do | ||
it "returns the class refined by the receiver" do | ||
refinement_int = nil | ||
|
||
Module.new do | ||
refine Integer do | ||
refinement_int = self | ||
end | ||
end | ||
|
||
refinement_int.send(@method).should == Integer | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
require_relative "../../spec_helper" | ||
require_relative 'shared/target' | ||
|
||
describe "Refinement#target" do | ||
ruby_version_is "3.3" do | ||
it_behaves_like :refinement_target, :target | ||
end | ||
end |