Sha256: 5f572b6aa8aff6ca04d128c617df5947ad31fb964a269b9829ebde1d0d7ce568

Contents?: true

Size: 687 Bytes

Versions: 5

Compression:

Stored size: 687 Bytes

Contents

# frozen_string_literal: true

describe RSpec do
  let! :command do
    Class.new(SlackRubyBot::Commands::Base) do
      command 'raise' do |_client, _data, match|
        raise ArgumentError, match[:command]
      end

      attachment 'raise' do |_client, data, _match|
        raise ArgumentError, data.attachments[0].pretext
      end
    end
  end
  def app
    SlackRubyBot::App.new
  end
  it 'respond_with_error' do
    expect(message: "#{SlackRubyBot.config.user} raise").to respond_with_error(ArgumentError, 'raise')
  end
  it 'respond_with_error_using_attachment_match' do
    expect(attachments: { pretext: 'raise' }).to respond_with_error(ArgumentError, 'raise')
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
slack-ruby-bot-0.16.1 spec/slack-ruby-bot/rspec/respond_with_error_spec.rb
slack-ruby-bot-0.16.0 spec/slack-ruby-bot/rspec/respond_with_error_spec.rb
slack-ruby-bot-0.15.0 spec/slack-ruby-bot/rspec/respond_with_error_spec.rb
slack-ruby-bot-0.14.0 spec/slack-ruby-bot/rspec/respond_with_error_spec.rb
slack-ruby-bot-0.13.0 spec/slack-ruby-bot/rspec/respond_with_error_spec.rb