Sha256: d8941ffb6cf309b735a55b52cce1df283d795e987ecc0dd3c52bc3523ba1a224

Contents?: true

Size: 450 Bytes

Versions: 9

Compression:

Stored size: 450 Bytes

Contents

module WithCommand
  def out
    @out ||= OutRecorder.new
  end

  def run_command!
    CandyCheck::CLI::Out.stub :new, out do
      subject.run(*arguments)
    end
  end

  def arguments
    []
  end

  class OutRecorder
    def lines
      @lines ||= []
    end

    def print(text = '')
      lines << text
    end

    def pretty(object)
      lines << object
    end

    def must_be(*expected)
      lines.must_equal expected
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
candy_check-0.3.0 spec/support/with_command.rb
candy_check-0.2.1 spec/support/with_command.rb
candy_check-0.2.0 spec/support/with_command.rb
candy_check-0.1.2 spec/support/with_command.rb
candy_check-0.1.1 spec/support/with_command.rb
candy_check-0.1.0.pre spec/support/with_command.rb
candy_check-0.0.5 spec/support/with_command.rb
candy_check-0.0.3 spec/support/with_command.rb
candy_check-0.0.2 spec/support/with_command.rb