test/test.rb in pry-0.4.8 vs test/test.rb in pry-0.5.0pre2
- old
+ new
@@ -198,16 +198,16 @@
it "should error if more than one argument is passed to Object#pry" do
lambda { pry(20, :input => Readline) }.should.raise ArgumentError
end
end
- describe "Pry#binding_for" do
+ describe "Pry.binding_for" do
it 'should return TOPLEVEL_BINDING if parameter self is main' do
_main_ = lambda { TOPLEVEL_BINDING.eval('self') }
- Pry.new.binding_for(_main_.call).is_a?(Binding).should == true
- Pry.new.binding_for(_main_.call).should == TOPLEVEL_BINDING
- Pry.new.binding_for(_main_.call).should == Pry.new.binding_for(_main_.call)
+ Pry.binding_for(_main_.call).is_a?(Binding).should == true
+ Pry.binding_for(_main_.call).should == TOPLEVEL_BINDING
+ Pry.binding_for(_main_.call).should == Pry.binding_for(_main_.call)
end
end
describe "test Pry defaults" do
@@ -344,11 +344,11 @@
command "v" do
end
end
Command3.commands.include?("nesting").should == true
- Command3.commands.include?("jump_to").should == true
+ Command3.commands.include?("jump-to").should == true
Command3.commands.include?("cd").should == true
Command3.commands.include?("v").should == true
Object.remove_const(:Command3)
end
@@ -420,11 +420,11 @@
Object.remove_const(:Command4)
end
it 'should import commands from another command object' do
class Command3 < Pry::CommandBase
- import_from Pry::Commands, "status", "jump_to"
+ import_from Pry::Commands, "status", "jump-to"
end
str_output = StringIO.new
Pry.new(:print => proc {}, :input => InputTester.new("status"),
:output => str_output, :commands => Command3).rep("john")
@@ -441,11 +441,11 @@
delete "show_doc", "show_method"
delete "ls"
end
Command3.commands.include?("nesting").should == true
- Command3.commands.include?("jump_to").should == true
+ Command3.commands.include?("jump-to").should == true
Command3.commands.include?("cd").should == true
Command3.commands.include?("v").should == true
Command3.commands.include?("show_doc").should == false
Command3.commands.include?("show_method").should == false
Command3.commands.include?("ls").should == false
@@ -453,12 +453,12 @@
Object.remove_const(:Command3)
end
it 'should override some inherited commands' do
class Command3 < Pry::Commands
- command "jump_to" do
- output.puts "jump_to the music"
+ command "jump-to" do
+ output.puts "jump-to the music"
end
command "help" do
output.puts "help to the music"
end
@@ -466,11 +466,11 @@
# suppress evaluation output
Pry.print = proc {}
str_output = StringIO.new
- Pry.new(:input => InputTester.new("jump_to"), :output => str_output, :commands => Command3).rep
- str_output.string.chomp.should == "jump_to the music"
+ Pry.new(:input => InputTester.new("jump-to"), :output => str_output, :commands => Command3).rep
+ str_output.string.chomp.should == "jump-to the music"
str_output = StringIO.new
Pry.new(:input => InputTester.new("help"), :output => str_output, :commands => Command3).rep
str_output.string.chomp.should == "help to the music"