1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00

Fix JRuby-specific warnings

This commit is contained in:
Matijs van Zuijlen 2015-01-23 14:56:19 +01:00
parent 5e8d69e8b3
commit ffff9ba85a
2 changed files with 5 additions and 4 deletions

View file

@ -11,7 +11,8 @@ class Pry
super(_pry_)
@interrogatee = interrogatee
@no_user_opts = no_user_opts
@ppp_switch = nil
@ppp_switch = opts[:ppp]
@jruby_switch = opts['all-java']
end
def output_self

View file

@ -359,17 +359,17 @@ describe Pry::Method do
it "should attribute overridden methods to the sub-class' singleton class" do
@class = Class.new(Class.new{ class << self; def meth; 1; end; end }) { class << self; def meth; 1; end; end }
Pry::Method.all_from_obj(@class).detect{ |x| x.name == 'meth' }.owner.should eq (class << @class; self; end)
Pry::Method.all_from_obj(@class).detect{ |x| x.name == 'meth' }.owner.should eq(class << @class; self; end)
end
it "should attrbute overridden methods to the class not the module" do
@class = Class.new { class << self; def meth; 1; end; end; extend Module.new{ def meth; 1; end; } }
Pry::Method.all_from_obj(@class).detect{ |x| x.name == 'meth' }.owner.should eq (class << @class; self; end)
Pry::Method.all_from_obj(@class).detect{ |x| x.name == 'meth' }.owner.should eq(class << @class; self; end)
end
it "should attribute overridden methods to the relevant singleton class in preference to Class" do
@class = Class.new { class << self; def allocate; 1; end; end }
Pry::Method.all_from_obj(@class).detect{ |x| x.name == 'allocate' }.owner.should eq (class << @class; self; end)
Pry::Method.all_from_obj(@class).detect{ |x| x.name == 'allocate' }.owner.should eq(class << @class; self; end)
end
end