Sha256: 8f3d31556291be8187ee9bce1079910ebbbc086b137768fed7879eed0d80483a

Contents?: true

Size: 530 Bytes

Versions: 56

Compression:

Stored size: 530 Bytes

Contents

require 'English'

module Overcommit::GitHook
  # Try to avoid commiting code which breaks specs.
  # Install the hook with `overcommit .` in the top directory.
  class SpecsPass < HookSpecificCheck
    include HookRegistry
    file_types :rb

    def run_check
      unless in_path?('rspec')
        return :warn, 'rspec not installed -- run `gem install rspec`'
      end

      output = `rspec 2>&1`
      if $CHILD_STATUS.exitstatus == 0
        return :good
      else
        return :bad, output
      end
    end
  end
end

Version data entries

56 entries across 56 versions & 1 rubygems

Version Path
conjur-cli-5.6.6 .githooks/pre_commit/run_specs.rb
conjur-cli-5.6.5 .githooks/pre_commit/run_specs.rb
conjur-cli-5.6.4 .githooks/pre_commit/run_specs.rb
conjur-cli-5.6.3 .githooks/pre_commit/run_specs.rb
conjur-cli-5.5.0 .githooks/pre_commit/run_specs.rb
conjur-cli-5.4.0 .githooks/pre_commit/run_specs.rb
conjur-cli-5.3.0 .githooks/pre_commit/run_specs.rb
conjur-cli-5.2.5 .githooks/pre_commit/run_specs.rb
conjur-cli-5.2.4 .githooks/pre_commit/run_specs.rb
conjur-cli-5.2.3 .githooks/pre_commit/run_specs.rb
conjur-cli-5.2.1 .githooks/pre_commit/run_specs.rb
conjur-cli-5.2.0 .githooks/pre_commit/run_specs.rb
conjur-cli-5.1.2 .githooks/pre_commit/run_specs.rb
conjur-cli-5.1.1 .githooks/pre_commit/run_specs.rb
conjur-cli-5.1.0 .githooks/pre_commit/run_specs.rb
conjur-cli-4.30.1 .githooks/pre_commit/run_specs.rb
conjur-cli-4.30.0 .githooks/pre_commit/run_specs.rb
conjur-cli-4.29.0 .githooks/pre_commit/run_specs.rb
conjur-cli-4.28.2 .githooks/pre_commit/run_specs.rb
conjur-cli-4.28.1 .githooks/pre_commit/run_specs.rb