X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=spec%2Fpronto%2Feslint_spec.rb;h=1117e15f1ed4372a9f565e7efd61e0e22ab1cc11;hb=fb94b0e6df4da3026b9fb4714ee7ceab6bbfa9bc;hp=8bd0bc848f1bcf193945fc9262925cc9219c446a;hpb=9be00a3292ddbbf280ac6d92b5b8add7f8ae9508;p=github%2Ffretlink%2Fpronto-hlint.git diff --git a/spec/pronto/eslint_spec.rb b/spec/pronto/eslint_spec.rb index 8bd0bc8..1117e15 100644 --- a/spec/pronto/eslint_spec.rb +++ b/spec/pronto/eslint_spec.rb @@ -2,10 +2,10 @@ require 'spec_helper' module Pronto describe ESLint do - let(:eslint) { ESLint.new } + let(:eslint) { ESLint.new(patches) } describe '#run' do - subject { eslint.run(patches, nil) } + subject { eslint.run } context 'patches are nil' do let(:patches) { nil } @@ -17,14 +17,23 @@ module Pronto it { should == [] } end - context 'patches with a four warnings' do + context 'patches with a four and a five warnings' do include_context 'test repo' let(:patches) { repo.diff('master') } - its(:count) { should == 4 } + its(:count) { should == 9 } its(:'first.msg') { should == "Expected { after 'if' condition." } end + + context 'repo with ignored and not ignored file, each with five warnings' do + include_context 'eslintignore repo' + + let(:patches) { repo.diff('master') } + + its(:count) { should == 5 } + its(:'first.msg') { should == "Use the function form of 'use strict'." } + end end end end