Sha256: cbe8e921b32d851d5d203f4ace56beff288ebe0340ce877639e5cde88dba98ab

Contents?: true

Size: 954 Bytes

Versions: 16

Compression:

Stored size: 954 Bytes

Contents

require 'spec_helper'

module Beaker
  describe FreeBSD::Exec do
    class FreeBSDExecTest
      include FreeBSD::Exec

      def initialize(hash, logger)
        @hash = hash
        @logger = logger
      end

      def [](k)
        @hash[k]
      end

      def to_s
        "me"
      end
    end

    let(:opts)     { @opts || {} }
    let(:logger)   { double('logger').as_null_object }
    let(:instance) { FreeBSDExecTest.new(opts, logger) }

    context "echo_to_file" do
      it "runs the correct echo command" do
        expect(Beaker::Command).to receive(:new).with('printf "127.0.0.1\tlocalhost localhost.localdomain\n10.255.39.23\tfreebsd-10-x64\n" > /etc/hosts').and_return('')
        expect(instance).to receive(:exec).with('').and_return(generate_result("hello", { :exit_code => 0 }))
        instance.echo_to_file('127.0.0.1\tlocalhost localhost.localdomain\n10.255.39.23\tfreebsd-10-x64\n', '/etc/hosts')
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
beaker-6.4.1 spec/beaker/host/freebsd/exec_spec.rb
beaker-6.4.0 spec/beaker/host/freebsd/exec_spec.rb
beaker-6.3.0 spec/beaker/host/freebsd/exec_spec.rb
beaker-6.2.0 spec/beaker/host/freebsd/exec_spec.rb
beaker-6.1.0 spec/beaker/host/freebsd/exec_spec.rb
beaker-5.8.1 spec/beaker/host/freebsd/exec_spec.rb
beaker-5.8.0 spec/beaker/host/freebsd/exec_spec.rb
beaker-5.7.0 spec/beaker/host/freebsd/exec_spec.rb
beaker-5.6.0 spec/beaker/host/freebsd/exec_spec.rb
beaker-5.5.0 spec/beaker/host/freebsd/exec_spec.rb
beaker-5.4.0 spec/beaker/host/freebsd/exec_spec.rb
beaker-5.3.1 spec/beaker/host/freebsd/exec_spec.rb
beaker-5.3.0 spec/beaker/host/freebsd/exec_spec.rb
beaker-5.2.0 spec/beaker/host/freebsd/exec_spec.rb
beaker-5.1.0 spec/beaker/host/freebsd/exec_spec.rb
beaker-5.0.0 spec/beaker/host/freebsd/exec_spec.rb