Sha256: 6800a6fc7e43556b5a55978f48611cda13867d0f99ce43356011d3b1033b2100

Contents?: true

Size: 893 Bytes

Versions: 5

Compression:

Stored size: 893 Bytes

Contents

# frozen_string_literal: true

describe SlackRubyBot::Commands::Support::Attrs do
  let(:help_attrs) { described_class.new('WeatherBot') }

  it 'captures commands help attributes' do
    expect(help_attrs.commands).to be_empty

    sample_title = 'how\'s the weather?'
    sample_desc = 'Tells you the weather in a <city>.'
    sample_long_desc = "Accurate 10 Day Weather Forecasts for thousands of places around the World.\n" \
      'We provide detailed Weather Forecasts over a 10 day period updated four times a day.'

    help_attrs.command(sample_title) do
      desc sample_desc
      long_desc sample_long_desc
    end

    expect(help_attrs.commands.count).to eq(1)
    command = help_attrs.commands.first
    expect(command.command_name).to eq(sample_title)
    expect(command.command_desc).to eq(sample_desc)
    expect(command.command_long_desc).to eq(sample_long_desc)
  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/support/attrs_spec.rb
slack-ruby-bot-0.16.0 spec/slack-ruby-bot/commands/support/attrs_spec.rb
slack-ruby-bot-0.15.0 spec/slack-ruby-bot/commands/support/attrs_spec.rb
slack-ruby-bot-0.14.0 spec/slack-ruby-bot/commands/support/attrs_spec.rb
slack-ruby-bot-0.13.0 spec/slack-ruby-bot/commands/support/attrs_spec.rb