From 2add678227641788598b6df1c29ae492fb384482 Mon Sep 17 00:00:00 2001 From: Markus Doits Date: Sun, 11 Sep 2016 13:59:30 +0200 Subject: change rspec syntax to expect --- spec/pronto/eslint_spec.rb | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) (limited to 'spec/pronto') 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 let(:eslint) { ESLintNpm.new(patches) } describe '#run' do - subject { eslint.run } + subject(:run) { eslint.run } context 'patches are nil' do let(:patches) { nil } - it { should == [] } + + it 'returns an empty array' do + expect(run).to eql([]) + end end context 'no patches' do let(:patches) { [] } - it { should == [] } + + it 'returns an empty array' do + expect(run).to eql([]) + end end context 'patches with a one and a four warnings' do @@ -22,8 +28,13 @@ module Pronto let(:patches) { repo.diff('master') } - its(:count) { should == 5 } - its(:'first.msg') { should == "'foo' is not defined." } + it 'returns correct number of errors' do + expect(run.count).to eql(5) + end + + it 'has correct first message' do + expect(run.first.msg).to eql("'foo' is not defined.") + end end context 'repo with ignored and not ignored file, each with three warnings' do @@ -31,8 +42,13 @@ module Pronto let(:patches) { repo.diff('master') } - its(:count) { should == 3 } - its(:'first.msg') { should == "'HelloWorld' is defined but never used." } + it 'returns correct number of errors' do + expect(run.count).to eql(3) + end + + it 'has correct first message' do + expect(run.first.msg).to eql("'HelloWorld' is defined but never used.") + end end end end -- cgit v1.2.3