Sha256: e4850ceff617ebee63cc8beb22a581234386be71c5332415f021cbbbba53be33

Contents?: true

Size: 964 Bytes

Versions: 143

Compression:

Stored size: 964 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

143 entries across 143 versions & 1 rubygems

Version Path
beaker-3.29.0 spec/beaker/host/freebsd/exec_spec.rb
beaker-3.28.0 spec/beaker/host/freebsd/exec_spec.rb
beaker-3.27.0 spec/beaker/host/freebsd/exec_spec.rb
beaker-3.26.0 spec/beaker/host/freebsd/exec_spec.rb
beaker-3.25.0 spec/beaker/host/freebsd/exec_spec.rb
beaker-3.24.0 spec/beaker/host/freebsd/exec_spec.rb
beaker-3.23.0 spec/beaker/host/freebsd/exec_spec.rb
beaker-3.22.0 spec/beaker/host/freebsd/exec_spec.rb
beaker-3.21.1 spec/beaker/host/freebsd/exec_spec.rb
beaker-3.21.0 spec/beaker/host/freebsd/exec_spec.rb
beaker-3.20.0 spec/beaker/host/freebsd/exec_spec.rb
beaker-3.19.0 spec/beaker/host/freebsd/exec_spec.rb
beaker-3.18.0 spec/beaker/host/freebsd/exec_spec.rb
beaker-3.17.0 spec/beaker/host/freebsd/exec_spec.rb
beaker-3.16.0 spec/beaker/host/freebsd/exec_spec.rb
beaker-3.15.0 spec/beaker/host/freebsd/exec_spec.rb
beaker-3.14.0 spec/beaker/host/freebsd/exec_spec.rb
beaker-3.13.0 spec/beaker/host/freebsd/exec_spec.rb
beaker-3.12.0 spec/beaker/host/freebsd/exec_spec.rb
beaker-3.11.0 spec/beaker/host/freebsd/exec_spec.rb