Sha256: 69a26bdae4a206ceca13df291352f08e867a47c3c345de4aa435a2c7e4e720d3

Contents?: true

Size: 501 Bytes

Versions: 1

Compression:

Stored size: 501 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)

      $stdin.expects(:gets).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

1 entries across 1 versions & 1 rubygems

Version Path
mayl-0.1.0 test/mayl/repl_test.rb