Sha256: 995838bf064f7901906f66b305af0b6f97c0f34ca678044eac8030dad732ac49

Contents?: true

Size: 612 Bytes

Versions: 8

Compression:

Stored size: 612 Bytes

Contents

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

8 entries across 8 versions & 1 rubygems

Version Path
slack-ruby-bot-0.12.0 spec/slack-ruby-bot/commands/commands_spaces_spec.rb
slack-ruby-bot-0.11.2 spec/slack-ruby-bot/commands/commands_spaces_spec.rb
slack-ruby-bot-0.11.1 spec/slack-ruby-bot/commands/commands_spaces_spec.rb
slack-ruby-bot-0.11.0 spec/slack-ruby-bot/commands/commands_spaces_spec.rb
slack-ruby-bot-0.10.5 spec/slack-ruby-bot/commands/commands_spaces_spec.rb
slack-ruby-bot-0.10.4 spec/slack-ruby-bot/commands/commands_spaces_spec.rb
slack-ruby-bot-0.10.3 spec/slack-ruby-bot/commands/commands_spaces_spec.rb
slack-ruby-bot-0.10.2 spec/slack-ruby-bot/commands/commands_spaces_spec.rb