Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change #public?, #protected? and #private? specs for Method #1033

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions core/method/private_spec.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
require_relative '../../spec_helper'
require_relative 'fixtures/classes'

ruby_version_is "3.1"..."3.2" do
describe "Method#private?" do
describe "Method#private?" do
ruby_version_is "3.1"..."3.2" do
it "returns false when the method is public" do
obj = MethodSpecs::Methods.new
obj.method(:my_public_method).private?.should == false
Expand All @@ -18,4 +18,11 @@
obj.method(:my_private_method).private?.should == true
end
end

ruby_version_is "3.2" do
it "has been removed" do
obj = MethodSpecs::Methods.new
obj.method(:my_private_method).should_not.respond_to?(:private?)
end
end
end
11 changes: 9 additions & 2 deletions core/method/protected_spec.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
require_relative '../../spec_helper'
require_relative 'fixtures/classes'

ruby_version_is "3.1"..."3.2" do
describe "Method#protected?" do
describe "Method#protected?" do
ruby_version_is "3.1"..."3.2" do
it "returns false when the method is public" do
obj = MethodSpecs::Methods.new
obj.method(:my_public_method).protected?.should == false
Expand All @@ -18,4 +18,11 @@
obj.method(:my_private_method).protected?.should == false
end
end

ruby_version_is "3.2" do
it "has been removed" do
obj = MethodSpecs::Methods.new
obj.method(:my_protected_method).should_not.respond_to?(:protected?)
end
end
end
11 changes: 9 additions & 2 deletions core/method/public_spec.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
require_relative '../../spec_helper'
require_relative 'fixtures/classes'

ruby_version_is "3.1"..."3.2" do
describe "Method#public?" do
describe "Method#public?" do
ruby_version_is "3.1"..."3.2" do
it "returns true when the method is public" do
obj = MethodSpecs::Methods.new
obj.method(:my_public_method).public?.should == true
Expand All @@ -18,4 +18,11 @@
obj.method(:my_private_method).public?.should == false
end
end

ruby_version_is "3.2" do
it "has been removed" do
obj = MethodSpecs::Methods.new
obj.method(:my_public_method).should_not.respond_to?(:public?)
end
end
end
11 changes: 9 additions & 2 deletions core/unboundmethod/private_spec.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
require_relative '../../spec_helper'
require_relative 'fixtures/classes'

ruby_version_is "3.1"..."3.2" do
describe "UnboundMethod#private?" do
describe "UnboundMethod#private?" do
ruby_version_is "3.1"..."3.2" do
it "returns false when the method is public" do
obj = UnboundMethodSpecs::Methods.new
obj.method(:my_public_method).unbind.private?.should == false
Expand All @@ -18,4 +18,11 @@
obj.method(:my_private_method).unbind.private?.should == true
end
end

ruby_version_is "3.2" do
it "has been removed" do
obj = UnboundMethodSpecs::Methods.new
obj.method(:my_private_method).unbind.should_not.respond_to?(:private?)
end
end
end
11 changes: 9 additions & 2 deletions core/unboundmethod/protected_spec.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
require_relative '../../spec_helper'
require_relative 'fixtures/classes'

ruby_version_is "3.1"..."3.2" do
describe "UnboundMethod#protected?" do
describe "UnboundMethod#protected?" do
ruby_version_is "3.1"..."3.2" do
it "returns false when the method is public" do
obj = UnboundMethodSpecs::Methods.new
obj.method(:my_public_method).unbind.protected?.should == false
Expand All @@ -18,4 +18,11 @@
obj.method(:my_private_method).unbind.protected?.should == false
end
end

ruby_version_is "3.2" do
it "has been removed" do
obj = UnboundMethodSpecs::Methods.new
obj.method(:my_protected_method).unbind.should_not.respond_to?(:protected?)
end
end
end
11 changes: 9 additions & 2 deletions core/unboundmethod/public_spec.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
require_relative '../../spec_helper'
require_relative 'fixtures/classes'

ruby_version_is "3.1"..."3.2" do
describe "UnboundMethod#public?" do
describe "UnboundMethod#public?" do
ruby_version_is "3.1"..."3.2" do
it "returns true when the method is public" do
obj = UnboundMethodSpecs::Methods.new
obj.method(:my_public_method).unbind.public?.should == true
Expand All @@ -18,4 +18,11 @@
obj.method(:my_private_method).unbind.public?.should == false
end
end

ruby_version_is "3.2" do
it "has been removed" do
obj = UnboundMethodSpecs::Methods.new
obj.method(:my_public_method).unbind.should_not.respond_to?(:public?)
end
end
end