]> git.immae.eu Git - github/fretlink/pronto-hlint.git/blobdiff - spec/spec_helper.rb
Respect `.eslintignore`
[github/fretlink/pronto-hlint.git] / spec / spec_helper.rb
index 4d1ff71e844417d065f1b5dc2d75e1c8d3f01555..5769c2d4a29159c9c5f84ff18c3392e419058ec4 100644 (file)
@@ -2,13 +2,15 @@ require 'rspec'
 require 'rspec/its'
 require 'pronto/eslint'
 
-RSpec.shared_context 'test repo' do
-  let(:git) { 'spec/fixtures/test.git/git' }
-  let(:dot_git) { 'spec/fixtures/test.git/.git' }
+%w(test eslintignore).each do |repo_name|
+  RSpec.shared_context "#{repo_name} repo" do
+    let(:git) { "spec/fixtures/#{repo_name}.git/git" }
+    let(:dot_git) { "spec/fixtures/#{repo_name}.git/.git" }
 
-  before { FileUtils.mv(git, dot_git) }
-  let(:repo) { Pronto::Git::Repository.new('spec/fixtures/test.git') }
-  after { FileUtils.mv(dot_git, git) }
+    before { FileUtils.mv(git, dot_git) }
+    let(:repo) { Pronto::Git::Repository.new("spec/fixtures/#{repo_name}.git") }
+    after { FileUtils.mv(dot_git, git) }
+  end
 end
 
 RSpec.configure do |config|