Sha256: 9e6b992bfbbd43fde679fe0ade6480dbd6f1e1a6cc6f5b7a4f19cd1ff9caf7a4
Contents?: true
Size: 721 Bytes
Versions: 27
Compression:
Stored size: 721 Bytes
Contents
require 'lib/spec_helper' require 'opal/repl' RSpec.describe Opal::REPL do describe '#eval_ruby' do let(:input_and_output) { { 'puts 5' => "5\n=> nil\n", 'a = 1' => "=> 1\n", 'a += 1' => "=> 2\n", 'a + 3' => "=> 5\n", 'puts a + 3' => "5\n=> nil\n", '"#{a} + 3"' => "=> \"2 + 3\"\n", 'puts "#{a} + 3"' => "2 + 3\n=> nil\n", } } subject(:repl) { described_class.new } it 'evaluates user inputs' do repl.colorize = false repl.load_opal input_and_output.each do |input, output| expect { repl.eval_ruby(input) }.to output(output).to_stdout end repl.finish end end end
Version data entries
27 entries across 27 versions & 1 rubygems