Sha256: 2ffdeac79b48a36534d6e2a4ae8b98b95c7892df76b554ce172035bfa066698c

Contents?: true

Size: 642 Bytes

Versions: 10

Compression:

Stored size: 642 Bytes

Contents

require 'spec_helper'
require 'reek/cli/help_command'

include Reek::Cli

describe HelpCommand do
  before :each do
    @help_text = 'Piece of interesting text'
    @parser = double('parser')
    allow(@parser).to receive(:help_text).and_return @help_text
    @cmd = HelpCommand.new(@parser)
    @view = double('view').as_null_object
  end

  it 'displays the correct text on the view' do
    expect(@view).to receive(:output).with(@help_text)
    @cmd.execute(@view)
  end

  it 'tells the view it succeeded' do
    expect(@view).not_to receive(:report_smells)
    expect(@view).to receive(:report_success)
    @cmd.execute(@view)
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
reek-1.6.6 spec/reek/cli/help_command_spec.rb
reek-1.6.5 spec/reek/cli/help_command_spec.rb
reek-1.6.4 spec/reek/cli/help_command_spec.rb
reek-1.6.3 spec/reek/cli/help_command_spec.rb
reek-1.6.2 spec/reek/cli/help_command_spec.rb
reek-1.6.1 spec/reek/cli/help_command_spec.rb
reek-1.6.0 spec/reek/cli/help_command_spec.rb
reek-1.5.1 spec/reek/cli/help_command_spec.rb
reek-1.5.0 spec/reek/cli/help_command_spec.rb
reek-1.4.0 spec/reek/cli/help_command_spec.rb