Sha256: 63ac12d12167d2ac4f466ee524a160e547b39322e910bedfb66f2caaec96ff2e

Contents?: true

Size: 643 Bytes

Versions: 5

Compression:

Stored size: 643 Bytes

Contents

# frozen_string_literal: true

describe SlackRubyBot::Commands do
  let! :command do
    Class.new(SlackRubyBot::Commands::Base) do
      command 'space' do |client, data, match|
        client.say(channel: data.channel, text: "#{match[:command]}: #{match[:expression]}")
      end
    end
  end
  def app
    SlackRubyBot::App.new
  end
  it 'matches leading spaces' do
    expect(message: "  #{SlackRubyBot.config.user}   space red").to respond_with_slack_message('space: red')
  end
  it 'matches trailing spaces' do
    expect(message: "#{SlackRubyBot.config.user}   space    red   ").to respond_with_slack_message('space: red')
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
slack-ruby-bot-0.16.1 spec/slack-ruby-bot/commands/commands_spaces_spec.rb
slack-ruby-bot-0.16.0 spec/slack-ruby-bot/commands/commands_spaces_spec.rb
slack-ruby-bot-0.15.0 spec/slack-ruby-bot/commands/commands_spaces_spec.rb
slack-ruby-bot-0.14.0 spec/slack-ruby-bot/commands/commands_spaces_spec.rb
slack-ruby-bot-0.13.0 spec/slack-ruby-bot/commands/commands_spaces_spec.rb