aboutsummaryrefslogtreecommitdiffhomepage
path: root/spec/pronto
diff options
context:
space:
mode:
Diffstat (limited to 'spec/pronto')
-rw-r--r--spec/pronto/eslint_spec.rb30
1 files changed, 23 insertions, 7 deletions
diff --git a/spec/pronto/eslint_spec.rb b/spec/pronto/eslint_spec.rb
index 63d0d68..2065998 100644
--- a/spec/pronto/eslint_spec.rb
+++ b/spec/pronto/eslint_spec.rb
@@ -5,16 +5,22 @@ module Pronto
5 let(:eslint) { ESLintNpm.new(patches) } 5 let(:eslint) { ESLintNpm.new(patches) }
6 6
7 describe '#run' do 7 describe '#run' do
8 subject { eslint.run } 8 subject(:run) { eslint.run }
9 9
10 context 'patches are nil' do 10 context 'patches are nil' do
11 let(:patches) { nil } 11 let(:patches) { nil }
12 it { should == [] } 12
13 it 'returns an empty array' do
14 expect(run).to eql([])
15 end
13 end 16 end
14 17
15 context 'no patches' do 18 context 'no patches' do
16 let(:patches) { [] } 19 let(:patches) { [] }
17 it { should == [] } 20
21 it 'returns an empty array' do
22 expect(run).to eql([])
23 end
18 end 24 end
19 25
20 context 'patches with a one and a four warnings' do 26 context 'patches with a one and a four warnings' do
@@ -22,8 +28,13 @@ module Pronto
22 28
23 let(:patches) { repo.diff('master') } 29 let(:patches) { repo.diff('master') }
24 30
25 its(:count) { should == 5 } 31 it 'returns correct number of errors' do
26 its(:'first.msg') { should == "'foo' is not defined." } 32 expect(run.count).to eql(5)
33 end
34
35 it 'has correct first message' do
36 expect(run.first.msg).to eql("'foo' is not defined.")
37 end
27 end 38 end
28 39
29 context 'repo with ignored and not ignored file, each with three warnings' do 40 context 'repo with ignored and not ignored file, each with three warnings' do
@@ -31,8 +42,13 @@ module Pronto
31 42
32 let(:patches) { repo.diff('master') } 43 let(:patches) { repo.diff('master') }
33 44
34 its(:count) { should == 3 } 45 it 'returns correct number of errors' do
35 its(:'first.msg') { should == "'HelloWorld' is defined but never used." } 46 expect(run.count).to eql(3)
47 end
48
49 it 'has correct first message' do
50 expect(run.first.msg).to eql("'HelloWorld' is defined but never used.")
51 end
36 end 52 end
37 end 53 end
38 end 54 end