Sha256: 09b4831a8506f88c2867d7c2c221c876da5cb76fdee4212cd605b5c8649ca570

Contents?: true

Size: 1.37 KB

Versions: 1

Compression:

Stored size: 1.37 KB

Contents

# frozen_string_literal: true

RSpec.describe 'bin/ego --template', type: :aruba do
  context 'without a query' do
    before(:each) { run_command('bin/ego --template') }

    it 'prints the plug-in template with default query' do
      # rubocop:disable Layout/EmptyLinesAroundArguments
      expect(last_command_started).to have_output an_output_string_being_eq(
        <<~TEMPLATE
          Ego.plugin do |robot|
            robot.can 'do something new'

            robot.on(/^My new plugin$/i) do |params|
              alert 'Not implemented yet. Go ahead and edit ~/.config/ego/plugins/my_new_plugin.rb.'
            end
          end
        TEMPLATE
      )
      # rubocop:enable Layout/EmptyLinesAroundArguments
    end
  end

  context 'with a query' do
    before(:each) { run_command('bin/ego --template help me out') }

    it 'prints the plug-in template with supplied query' do
      # rubocop:disable Layout/EmptyLinesAroundArguments
      expect(last_command_started).to have_output an_output_string_being_eq(
        <<~TEMPLATE
          Ego.plugin do |robot|
            robot.can 'do something new'

            robot.on(/^help me out$/i) do |params|
              alert 'Not implemented yet. Go ahead and edit ~/.config/ego/plugins/help_me_out.rb.'
            end
          end
        TEMPLATE
      )
      # rubocop:enable Layout/EmptyLinesAroundArguments
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ego-0.6.0 spec/ego/acceptance/template_spec.rb