Sha256: ed3e902fd9007d6136fa277d07b6e4c6f9f540f5facae845027d6686868d4d7e

Contents?: true

Size: 435 Bytes

Versions: 78

Compression:

Stored size: 435 Bytes

Contents

# protip to prevent execution of shell commands during testsuite
# see http://stackoverflow.com/questions/1628586/mock-system-call-in-ruby
module Kernel
  def execute_with_stub(cmd)
    if cmd.include?('git')
      puts "WARNING: stubbing command execution within tests of command: #{cmd}", :red
    else
      execute_without_stub(cmd)
    end
  end

  alias_method :execute_without_stub, :`
  alias_method :`, :execute_with_stub
end

Version data entries

78 entries across 78 versions & 2 rubygems

Version Path
gitx-2.14.2.ci.70.1 spec/support/stub_execution.rb
gitx-2.14.1.ci.62.1 spec/support/stub_execution.rb
gitx-2.14.1 spec/support/stub_execution.rb
gitx-2.14.0.ci.56.1 spec/support/stub_execution.rb
gitx-2.14.0 spec/support/stub_execution.rb
gitx-2.13.7 spec/support/stub_execution.rb
gitx-2.13.7.ci.52.1 spec/support/stub_execution.rb
gitx-2.13.6 spec/support/stub_execution.rb
gitx-2.13.6.ci.50.1 spec/support/stub_execution.rb
gitx-2.13.5.ci.46.1 spec/support/stub_execution.rb
gitx-2.13.5 spec/support/stub_execution.rb
gitx-2.13.4.ci.39.1 spec/support/stub_execution.rb
gitx-2.13.4 spec/support/stub_execution.rb
gitx-2.13.3 spec/support/stub_execution.rb
gitx-2.13.2 spec/support/stub_execution.rb
gitx-2.13.1 spec/support/stub_execution.rb
thegarage-gitx-2.13.1 spec/support/stub_execution.rb
thegarage-gitx-2.13.0 spec/support/stub_execution.rb
thegarage-gitx-2.12.0 spec/support/stub_execution.rb
thegarage-gitx-2.11.0 spec/support/stub_execution.rb