Sha256: ddfacf921563b57b54c2c37f3c455bb1a0bb6bc8fb7d8816dd310d347995674c

Contents?: true

Size: 554 Bytes

Versions: 8

Compression:

Stored size: 554 Bytes

Contents

describe SlackRubyBot::Commands do
  let! :command do
    Class.new(SlackRubyBot::Commands::Base) do
      command 'nil_text'

      def self.call(_client, data, _match)
        send_message client, data.channel, nil
      end
    end
  end

  let(:app) { SlackRubyBot::App.new }
  let(:client) { app.send(:client) }
  let(:message_hook) { SlackRubyBot::Hooks::Message.new }

  it 'ignores nil messages' do
    expect(client).to_not receive(:message)
    message_hook.call(client, Hashie::Mash.new(text: nil, channel: 'channel', user: 'user'))
  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/nil_message_spec.rb
slack-ruby-bot-0.11.2 spec/slack-ruby-bot/commands/nil_message_spec.rb
slack-ruby-bot-0.11.1 spec/slack-ruby-bot/commands/nil_message_spec.rb
slack-ruby-bot-0.11.0 spec/slack-ruby-bot/commands/nil_message_spec.rb
slack-ruby-bot-0.10.5 spec/slack-ruby-bot/commands/nil_message_spec.rb
slack-ruby-bot-0.10.4 spec/slack-ruby-bot/commands/nil_message_spec.rb
slack-ruby-bot-0.10.3 spec/slack-ruby-bot/commands/nil_message_spec.rb
slack-ruby-bot-0.10.2 spec/slack-ruby-bot/commands/nil_message_spec.rb