Sha256: f15e1429e330fe026832f60df0307094fd4360edcaf2d8e8b0009ab3b26bab42

Contents?: true

Size: 507 Bytes

Versions: 2

Compression:

Stored size: 507 Bytes

Contents

require 'test_helper'

module Mayl
  describe Repl do
    before do
      @repl = Mayl::Repl.new('test/support')
    end

    it 'parses and executes commands' do
      @foo = stub
      @foo.expects(:execute)
      @baz = stub
      @baz.expects(:execute)

      Readline.expects(:readline).times(3).returns("foo bar\n", "baz lol\n", nil)

      @repl.parser.expects(:parse).with('foo bar').returns @foo
      @repl.parser.expects(:parse).with('baz lol').returns @baz

      @repl.start
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mayl-0.2.1 test/mayl/repl_test.rb
mayl-0.2.0 test/mayl/repl_test.rb