Sha256: ee7d1a9c03fcead8466fe5ecb0f65bf6d6e894fd10fd0b4d87497cc6d4896332

Contents?: true

Size: 866 Bytes

Versions: 8

Compression:

Stored size: 866 Bytes

Contents

require 'spec_helper'
require 'yacli/run'

include Helpers

describe Yacli::Run do
  context 'run is successfull' do
    let(:opt) do
      {
        'cmd'     => 'date',
        'dry-run' => false,
      }
    end
    let(:output) { 'Success' }

    before do
      allow_any_instance_of(Yacli::Run).to receive(:pass_cli).and_return(nil)
    end

    it 'print date' do
      cmd = 'date'
      allow_any_instance_of(Yacli::Run).to receive(:pass_cli).with(cmd).and_return(output)
      run = Yacli::Run.new(opt)
      expect(run.go(cmd)).to eq output
    end

    # before do
    #  allow_any_instance_of(clazz).to receive(opts[:method]).and_return(true)
    #  Hecate::CLI.start
    # end

    # it "calls #{opts[:method]}" do
    #  cli = Hecate::CLI.new
    #  expect(cli.cli_cmd(class: opts[:class], method: opts[:method], opt: {})).to eq 0
    # end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
yacli-0.3.2 spec/cli_spec.rb
yacli-0.3.1 spec/cli_spec.rb
yacli-0.2.5 spec/cli_spec.rb
yacli-0.2.4 spec/cli_spec.rb
yacli-0.2.3 spec/cli_spec.rb
yacli-0.2.2 spec/cli_spec.rb
yacli-0.2.1 spec/cli_spec.rb
yacli-0.2.0 spec/cli_spec.rb