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 +++++++++++++++++++++++------- spec/spec_helper.rb | 6 +----- 2 files changed, 24 insertions(+), 12 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 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 diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 23f22e8..72a128b 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,3 +1,4 @@ +require 'fileutils' require 'rspec' require 'rspec/its' require 'pronto/eslint_npm' @@ -12,8 +13,3 @@ require 'pronto/eslint_npm' after { FileUtils.mv(dot_git, git) } end end - -RSpec.configure do |config| - config.expect_with(:rspec) { |c| c.syntax = :should } - config.mock_with(:rspec) { |c| c.syntax = :should } -end -- cgit v1.2.3