File tree 3 files changed +8
-3
lines changed
spec/overcommit/hook/pre_commit
3 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -31,5 +31,4 @@ Gem::Specification.new do |s|
31
31
32
32
s . add_development_dependency 'rspec' , '~> 3.0'
33
33
s . add_development_dependency 'travis' , '~> 1.7'
34
- s . add_development_dependency 'w3c_validators' , '~> 1.2'
35
34
end
Original file line number Diff line number Diff line change 1
1
require 'spec_helper'
2
- require 'w3c_validators'
3
2
4
3
describe Overcommit ::Hook ::PreCommit ::W3cCss do
5
4
let ( :config ) { Overcommit ::ConfigurationLoader . default_configuration }
6
5
let ( :context ) { double ( 'context' ) }
7
6
subject { described_class . new ( config , context ) }
8
7
8
+ let ( :fake_exception ) { Class . new ( StandardError ) }
9
+
9
10
before do
10
11
subject . stub ( :applicable_files ) . and_return ( %w[ file1.css file2.css ] )
12
+ stub_const ( 'W3CValidators::ValidatorUnavailable' , fake_exception )
13
+ stub_const ( 'W3CValidators::ParsingError' , fake_exception )
11
14
end
12
15
13
16
context 'when w3c_validators exits with an exception' do
Original file line number Diff line number Diff line change 1
1
require 'spec_helper'
2
- require 'w3c_validators'
3
2
4
3
describe Overcommit ::Hook ::PreCommit ::W3cHtml do
5
4
let ( :config ) { Overcommit ::ConfigurationLoader . default_configuration }
6
5
let ( :context ) { double ( 'context' ) }
7
6
subject { described_class . new ( config , context ) }
8
7
8
+ let ( :fake_exception ) { Class . new ( StandardError ) }
9
+
9
10
before do
10
11
subject . stub ( :applicable_files ) . and_return ( %w[ file1.html file2.html ] )
12
+ stub_const ( 'W3CValidators::ValidatorUnavailable' , fake_exception )
13
+ stub_const ( 'W3CValidators::ParsingError' , fake_exception )
11
14
end
12
15
13
16
context 'when w3c_validators exits with an exception' do
You can’t perform that action at this time.
0 commit comments