Sha256: a5a950ea016a46f89236368c713aa18c7aad3d5111f77b3709069faf9e0fc8b5

Contents?: true

Size: 676 Bytes

Versions: 6

Compression:

Stored size: 676 Bytes

Contents

module BetterErrors
  module REPL
    shared_examples "a good repl should" do
      it "should evaluate ruby code in a given context" do
        repl.send_input("local_a = 456")
        fresh_binding.eval("local_a").should == 456
      end
      
      it "should return a tuple of output and the new prompt" do
        output, prompt = repl.send_input("1 + 2")
        output.should == "=> 3\n"
        prompt.should == ">>"
      end
      
      it "should not barf if the code throws an exception" do
        output, prompt = repl.send_input("raise Exception")
        output.should include "Exception: Exception"
        prompt.should == ">>"
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
better_errors-0.9.0 spec/better_errors/repl/shared_examples.rb
better_errors-0.8.0 spec/better_errors/repl/shared_examples.rb
better_errors-0.7.2 spec/better_errors/repl/shared_examples.rb
better_errors-0.7.0 spec/better_errors/repl/shared_examples.rb
better_errors-0.6.0 spec/better_errors/repl/shared_examples.rb
better_errors-0.5.0 spec/better_errors/repl/shared_examples.rb