Sha256: 3b129c5f1907b7c6c0b7450912569b33d8edd2a1f9a1157c168aefb00831f889

Contents?: true

Size: 650 Bytes

Versions: 5

Compression:

Stored size: 650 Bytes

Contents

# frozen_string_literal: true

describe SlackRubyBot::Commands do
  let! :command do
    Class.new(SlackRubyBot::Commands::Base) do
      command(/some\s*regex+\?*/) do |client, data, match|
        client.say(channel: data.channel, text: "#{match[:command]}: #{match[:expression]}")
      end
    end
  end
  def app
    SlackRubyBot::App.new
  end
  it 'handles regular expressions' do
    expect(message: "#{SlackRubyBot.config.user} some regex works here").to respond_with_slack_message('some regex: works here')
    expect(message: "#{SlackRubyBot.config.user} some   RegEx?? yep").to respond_with_slack_message('some   RegEx??: yep')
  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_regexp_spec.rb
slack-ruby-bot-0.16.0 spec/slack-ruby-bot/commands/commands_regexp_spec.rb
slack-ruby-bot-0.15.0 spec/slack-ruby-bot/commands/commands_regexp_spec.rb
slack-ruby-bot-0.14.0 spec/slack-ruby-bot/commands/commands_regexp_spec.rb
slack-ruby-bot-0.13.0 spec/slack-ruby-bot/commands/commands_regexp_spec.rb