Module: Orb

Defined in:
lib/orb/runner.rb,
lib/orb/version.rb,
lib/orb/pry_extensions.rb

Defined Under Namespace

Classes: Runner

Constant Summary collapse

VERSION =
"0.1.5"
Commands =
Pry::CommandSet.new do
  command ",a", "Append the previous line to the buffer" do |*code|
    if code.empty?
      orb_test_buffer << _pry_.input_array[-1].chomp
    else
      orb_test_buffer << code.join(" ")
    end
  end

  command ",p", "Print contents of buffer" do
    puts orb_test_buffer
  end

  command ",e", "Edit contents of buffer" do
    orb_test_buffer.edit_contents!
  end

  command ",n", "Name or rename the current test" do |*name|
    orb_test_buffer.name = name.join(" ")
  end

  command ",r", "Run contents of buffer" do
    orb_test_buffer.run(_pry_.binding_stack[0])
  end

  command ",w", "Write the buffer to file" do
    orb_test_buffer.write
    puts "Test written!"
    throw(:breakout)
  end
end