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

use HEREDOC's to improve readability of eval string.

This commit is contained in:
Robert Gleeson 2014-03-14 07:31:17 +01:00
parent 82dc33445c
commit 9c3d2899eb

View file

@ -11,18 +11,19 @@ describe "Readline" do
end end
it "is not loaded on requiring 'pry'" do it "is not loaded on requiring 'pry'" do
`#@ruby -I #@pry_dir -e ' code = <<-RUBY
require "pry" require "pry"
p defined? Readline p defined?(Readline)
'`.should == "nil\n" RUBY
`#@ruby -I #@pry_dir -e '#{code}'`.should == "nil\n"
end end
it "is loaded on invoking 'pry'" do it "is loaded on invoking 'pry'" do
`#@ruby -I #@pry_dir -e ' code = <<-RUBY
require "pry" require "pry"
Pry.start self, input: StringIO.new("exit-all\n"), output: StringIO.new Pry.start self, input: StringIO.new("exit-all\n"), output: StringIO.new
puts # put newline after ANSI junk printed by readline puts defined?(Readline)
p defined?(Readline) RUBY
'`.split("\n").last.should == '"constant"' `#@ruby -I #@pry_dir -e '#{code}'`.end_with?("constant\n").should == true
end end
end end