]>
Commit | Line | Data |
---|---|---|
9be00a32 MM |
1 | require 'spec_helper' |
2 | ||
3 | module Pronto | |
4 | describe ESLint do | |
b338a7ad | 5 | let(:eslint) { ESLint.new(patches) } |
9be00a32 MM |
6 | |
7 | describe '#run' do | |
b338a7ad | 8 | subject { eslint.run } |
9be00a32 MM |
9 | |
10 | context 'patches are nil' do | |
11 | let(:patches) { nil } | |
12 | it { should == [] } | |
13 | end | |
14 | ||
15 | context 'no patches' do | |
16 | let(:patches) { [] } | |
17 | it { should == [] } | |
18 | end | |
19 | ||
e96fd240 | 20 | context 'patches with a four and a five warnings' do |
9be00a32 MM |
21 | include_context 'test repo' |
22 | ||
23 | let(:patches) { repo.diff('master') } | |
24 | ||
e96fd240 | 25 | its(:count) { should == 9 } |
9be00a32 MM |
26 | its(:'first.msg') { should == "Expected { after 'if' condition." } |
27 | end | |
fb94b0e6 MD |
28 | |
29 | context 'repo with ignored and not ignored file, each with five warnings' do | |
30 | include_context 'eslintignore repo' | |
31 | ||
32 | let(:patches) { repo.diff('master') } | |
33 | ||
34 | its(:count) { should == 5 } | |
35 | its(:'first.msg') { should == "Use the function form of 'use strict'." } | |
36 | end | |
9be00a32 MM |
37 | end |
38 | end | |
39 | end |