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.20.0.ci.117.1 spec/support/stub_execution.rb
gitx-2.19.0.ci.114.1 spec/support/stub_execution.rb
gitx-2.19.0.ci.112.1 spec/support/stub_execution.rb
gitx-2.19.0 spec/support/stub_execution.rb
gitx-2.18.0.ci.106.1 spec/support/stub_execution.rb
gitx-2.18.0 spec/support/stub_execution.rb
gitx-2.18.0.pre.ci.104.1 spec/support/stub_execution.rb
gitx-2.18.0.pre spec/support/stub_execution.rb
gitx-2.17.0.pre.ci.101.1 spec/support/stub_execution.rb
gitx-2.17.0.pre spec/support/stub_execution.rb
gitx-2.17.0.pre.ci.98.1 spec/support/stub_execution.rb
gitx-2.16.0.ci.91.1 spec/support/stub_execution.rb
gitx-2.16.0 spec/support/stub_execution.rb
gitx-2.16.0.ci.89.1 spec/support/stub_execution.rb
gitx-2.16.0.pre.ci.88.1 spec/support/stub_execution.rb
gitx-2.16.0.pre.ci.85.1 spec/support/stub_execution.rb
gitx-2.16.0.pre spec/support/stub_execution.rb
gitx-2.16.0.pre.ci.81.1 spec/support/stub_execution.rb
gitx-2.15.0 spec/support/stub_execution.rb
gitx-2.15.0.ci.75.1 spec/support/stub_execution.rb