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.23.0.ci.162.1 spec/support/stub_execution.rb
gitx-2.23.0 spec/support/stub_execution.rb
thegarage-gitx-2.14.0 spec/support/stub_execution.rb
gitx-2.22.0.ci.154.1 spec/support/stub_execution.rb
gitx-2.22.0 spec/support/stub_execution.rb
gitx-2.21.5.ci.153.1 spec/support/stub_execution.rb
gitx-2.21.5.ci.151.1 spec/support/stub_execution.rb
gitx-2.21.5 spec/support/stub_execution.rb
gitx-2.21.4.ci.145.1 spec/support/stub_execution.rb
gitx-2.21.4 spec/support/stub_execution.rb
gitx-2.21.3.ci.135.1 spec/support/stub_execution.rb
gitx-2.21.3 spec/support/stub_execution.rb
gitx-2.21.2.ci.134.1 spec/support/stub_execution.rb
gitx-2.21.2.ci.130.1 spec/support/stub_execution.rb
gitx-2.21.2 spec/support/stub_execution.rb
gitx-2.21.1.ci.125.1 spec/support/stub_execution.rb
gitx-2.21.1 spec/support/stub_execution.rb
gitx-2.21.0.ci.121.1 spec/support/stub_execution.rb
gitx-2.21.0 spec/support/stub_execution.rb
gitx-2.20.0 spec/support/stub_execution.rb