]> git.immae.eu Git - github/fretlink/pronto-hlint.git/commitdiff
change rspec syntax to expect
authorMarkus Doits <markus.doits@stellenticket.de>
Sun, 11 Sep 2016 11:59:30 +0000 (13:59 +0200)
committerMarkus Doits <markus.doits@stellenticket.de>
Sun, 11 Sep 2016 11:59:30 +0000 (13:59 +0200)
spec/pronto/eslint_spec.rb
spec/spec_helper.rb

index 63d0d684727f3f37de0ea7e86cdcd41f0df449fa..20659987c9404e31e24dd30d1e7c2238b3e27a34 100644 (file)
@@ -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
index 23f22e88925f6a0b12a8e3e3683394e0b22e2cc0..72a128b117866f826aa0d78b08fefe48d29889dd 100644 (file)
@@ -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