Sha256: fe2862b16bae9eeca6ba3ebce3932a010897884a8b6c0faa962a0356197e5d5a

Contents?: true

Size: 730 Bytes

Versions: 1

Compression:

Stored size: 730 Bytes

Contents

# frozen_string_literal: true

require 'ego/robot'

RSpec.describe Ego::Robot, 'with robot_io plug-in', plugin: 'robot_io' do
  it { should be_able_to 'output text to the terminal' }

  describe '#verbose?' do
    it 'is defined on the robot instance' do
      expect(subject.respond_to?(:verbose?)).to be true
    end
  end

  it { should be_able_to 'repeat what you say' }

  it { should handle_query 'say hello' }
  it { should handle_query 'echo hello' }
  it { should_not handle_query 'whatever you say' }
  it { should_not handle_query 'there is an echo in here' }

  it 'prints the input' do
    expect { subject.handle('say hello, robot') }.to output(
      <<~OUT
        hello, robot
      OUT
    ).to_stdout
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ego-0.6.0 spec/ego/plugins/robot_io_spec.rb