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