Sha256: 191885a4cc7a2be05c36636f243f0ef6c52df6df13cd2fb5d59f503ee9c013f6

Contents?: true

Size: 635 Bytes

Versions: 10

Compression:

Stored size: 635 Bytes

Contents

require 'spec_helper'

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

10 entries across 10 versions & 1 rubygems

Version Path
slack-ruby-bot-0.10.1 spec/slack-ruby-bot/commands/commands_spaces_spec.rb
slack-ruby-bot-0.10.0 spec/slack-ruby-bot/commands/commands_spaces_spec.rb
slack-ruby-bot-0.9.0 spec/slack-ruby-bot/commands/commands_spaces_spec.rb
slack-ruby-bot-0.8.2 spec/slack-ruby-bot/commands/commands_spaces_spec.rb
slack-ruby-bot-0.8.1 spec/slack-ruby-bot/commands/commands_spaces_spec.rb
slack-ruby-bot-0.8.0 spec/slack-ruby-bot/commands/commands_spaces_spec.rb
slack-ruby-bot-0.7.0 spec/slack-ruby-bot/commands/commands_spaces_spec.rb
slack-ruby-bot-0.6.2 spec/slack-ruby-bot/commands/commands_spaces_spec.rb
slack-ruby-bot-0.6.1 spec/slack-ruby-bot/commands/commands_spaces_spec.rb
slack-ruby-bot-0.6.0 spec/slack-ruby-bot/commands/commands_spaces_spec.rb