Sha256: 984f4eabd3de2919500208d9b6dcb5297b433ac49e8b044bd8764a95a4114c6e

Contents?: true

Size: 842 Bytes

Versions: 15

Compression:

Stored size: 842 Bytes

Contents

require "spec_helper"

describe Ruboty::Handlers::Help do
  let(:robot) do
    Ruboty::Robot.new
  end

  describe "#help" do
    let(:from) do
      "alice"
    end

    let(:to) do
      "#general"
    end

    let(:body) do
      <<-EOS.strip_heredoc.strip
        ruboty /help( me)?\\z/i - Show this help message
        ruboty /ping\\z/i       - Return PONG to PING
        ruboty /who am i\\?/i   - Answer who you are
      EOS
    end

    it "responds to `@ruboty help` and says each handler's usage" do
      robot.should_receive(:say).with(
        body: body,
        code: true,
        from: to,
        to: from,
        original: {
          body: "@ruboty help",
          from: from,
          robot: robot,
          to: to,
        },
      )
      robot.receive(body: "@ruboty help", from: from, to: to)
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
ruboty-1.1.9 spec/ruboty/handlers/help_spec.rb
ruboty-1.1.8 spec/ruboty/handlers/help_spec.rb
ruboty-1.1.7 spec/ruboty/handlers/help_spec.rb
ruboty-1.1.6 spec/ruboty/handlers/help_spec.rb
ruboty-1.1.5 spec/ruboty/handlers/help_spec.rb
ruboty-1.1.4 spec/ruboty/handlers/help_spec.rb
ruboty-1.1.3 spec/ruboty/handlers/help_spec.rb
ruboty-1.1.2 spec/ruboty/handlers/help_spec.rb
ruboty-1.1.1 spec/ruboty/handlers/help_spec.rb
ruboty-1.1.0 spec/ruboty/handlers/help_spec.rb
ruboty-1.0.4 spec/ruboty/handlers/help_spec.rb
ruboty-1.0.3 spec/ruboty/handlers/help_spec.rb
ruboty-1.0.2 spec/ruboty/handlers/help_spec.rb
ruboty-1.0.1 spec/ruboty/handlers/help_spec.rb
ruboty-1.0.0 spec/ruboty/handlers/help_spec.rb