Sha256: cc86944af2fcaa65787c726ea5be4ce532de394d911e2196078dc3b9830bb431

Contents?: true

Size: 407 Bytes

Versions: 7

Compression:

Stored size: 407 Bytes

Contents

# frozen_string_literal: true

module SlackRubyBot
  module SpecHelpers
    private

    def parse(actual)
      actual = { message: actual } unless actual.is_a?(Hash)
      attachments = actual[:attachments]
      attachments = [attachments] unless attachments.nil? || attachments.is_a?(Array)
      [actual[:channel] || 'channel', actual[:user] || 'user', actual[:message], attachments]
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
slackrb-0.17.1 lib/slack-ruby-bot/rspec/support/spec_helpers.rb
slackrb-0.17.0 lib/slack-ruby-bot/rspec/support/spec_helpers.rb
slack-ruby-bot-0.16.1 lib/slack-ruby-bot/rspec/support/spec_helpers.rb
slack-ruby-bot-0.16.0 lib/slack-ruby-bot/rspec/support/spec_helpers.rb
slack-ruby-bot-0.15.0 lib/slack-ruby-bot/rspec/support/spec_helpers.rb
slack-ruby-bot-0.14.0 lib/slack-ruby-bot/rspec/support/spec_helpers.rb
slack-ruby-bot-0.13.0 lib/slack-ruby-bot/rspec/support/spec_helpers.rb