Sha256: e4b51e27ac5c0970d3ab4d684f3896f9924a02043d50e8244b11a03f9fa58d5b

Contents?: true

Size: 585 Bytes

Versions: 5

Compression:

Stored size: 585 Bytes

Contents

# frozen_string_literal: true

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

5 entries across 5 versions & 1 rubygems

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