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