Sha256: 1e92170a8a9e6d393c1a4c7d8a6258ef14cc9c0f2db985fd9d480ce92d6561cf

Contents?: true

Size: 527 Bytes

Versions: 3

Compression:

Stored size: 527 Bytes

Contents

require_relative "spec_helper"

require "irb"
require "open3"
require "stringio"

require "cute_print"

describe CutePrint do

  it "should be able to inspect source when called from irb" do
    lib_path = File.join(File.dirname(__FILE__), "../lib/cute_print")
    stdout, stderr = Open3.popen3("irb") do |stdin, stdout, stderr, wait_thr|
      stdin.puts "require #{lib_path.inspect}"
      stdin.puts "q {1 + 2}"
      stdin.close
      [stdout.read, stderr.read]
    end
    expect(stderr).to eq "(1 + 2) is 3\n"
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cute_print-1.0.0 spec/irb_spec.rb
cute_print-0.4.0 spec/irb_spec.rb
cute_print-0.3.0 spec/irb_spec.rb