Sha256: 5f9de3092b286b63e994a918b21a8f2039ac0fe2651b8952ec661a9f96cb0a69

Contents?: true

Size: 1.33 KB

Versions: 11

Compression:

Stored size: 1.33 KB

Contents

require 'spec_helper'

module PrePush
	describe Validator do
		describe 'validate' do
			it "should fail when a .git dir doesn't exit" do
				Dir.stub('exists?').with('.git').and_return(false)
				PrePush::Validator.should_receive('puts').with("Couldn't find a git repository")
				PrePush::Validator.validate('nunit262').should be false
			end
			it "should fail when a .git/hooks dir doesn't exit" do
				Dir.stub('exists?').with('.git').and_return(true)
				Dir.stub('exists?').with('.git/hooks').and_return(false)
				PrePush::Validator.should_receive('puts').with("Couldn't find the git hooks dir")
				PrePush::Validator.validate('nunit262').should be false
			end
			it "should fail when runner not found" do
				Dir.stub('exists?').with('.git').and_return(true)
				Dir.stub('exists?').with('.git/hooks').and_return(true)
				PrePush::Validator.should_receive('puts').with(/^Couldn't find test runner non-existant-runner/)
				PrePush::Validator.validate('non-existant-runner').should be false
			end
			it "should validate when runner found" do
				Dir.stub('exists?').with('.git').and_return(true)
				Dir.stub('exists?').with('.git/hooks').and_return(true)
				Dir.stub('entries').with(/lib\/runners$/).and_return(['existant-runner'])
				PrePush::Validator.validate('existant-runner').should be true
			end
		end
	end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
pre_push-1.1.2.1 spec/prepush_validator_spec.rb
pre_push-1.1.2 spec/prepush_validator_spec.rb
pre_push-1.1.1 spec/prepush_validator_spec.rb
pre_push-1.1.0 spec/prepush_validator_spec.rb
pre_push-1.0.1 spec/prepush_validator_spec.rb
pre_push-1.0.0 spec/prepush_validator_spec.rb
pre_push-0.0.7 spec/prepush_validator_spec.rb
pre_push-0.0.6 spec/prepush_validator_spec.rb
pre_push-0.0.5 spec/prepush_validator_spec.rb
pre_push-0.0.4 spec/prepush_validator_spec.rb
pre_push-0.0.3 spec/prepush_validator_spec.rb