aboutsummaryrefslogtreecommitdiffhomepage
path: root/spec/spec_helper.rb
diff options
context:
space:
mode:
authorMarkus Doits <markus.doits@stellenticket.de>2016-07-25 14:36:23 +0200
committerMarkus Doits <markus.doits@stellenticket.de>2016-07-25 14:51:26 +0200
commitfb94b0e6df4da3026b9fb4714ee7ceab6bbfa9bc (patch)
tree57d22b50d28eab271a8db6fe201a7f18bbe069f4 /spec/spec_helper.rb
parent604e30d99fdbb7c822efe31d05a0238064220037 (diff)
downloadpronto-hlint-fb94b0e6df4da3026b9fb4714ee7ceab6bbfa9bc.tar.gz
pronto-hlint-fb94b0e6df4da3026b9fb4714ee7ceab6bbfa9bc.tar.zst
pronto-hlint-fb94b0e6df4da3026b9fb4714ee7ceab6bbfa9bc.zip
Respect `.eslintignore`
If an `.eslintignore` is present, it's patterns are now respected. See http://eslint.org/docs/user-guide/configuring#ignoring-files-and-directories for more info. Due to the file format of `.eslintignore`, the gem `globby` has to be used for those patterns (which respects negations etc.).
Diffstat (limited to 'spec/spec_helper.rb')
-rw-r--r--spec/spec_helper.rb14
1 files changed, 8 insertions, 6 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 4d1ff71..5769c2d 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -2,13 +2,15 @@ require 'rspec'
2require 'rspec/its' 2require 'rspec/its'
3require 'pronto/eslint' 3require 'pronto/eslint'
4 4
5RSpec.shared_context 'test repo' do 5%w(test eslintignore).each do |repo_name|
6 let(:git) { 'spec/fixtures/test.git/git' } 6 RSpec.shared_context "#{repo_name} repo" do
7 let(:dot_git) { 'spec/fixtures/test.git/.git' } 7 let(:git) { "spec/fixtures/#{repo_name}.git/git" }
8 let(:dot_git) { "spec/fixtures/#{repo_name}.git/.git" }
8 9
9 before { FileUtils.mv(git, dot_git) } 10 before { FileUtils.mv(git, dot_git) }
10 let(:repo) { Pronto::Git::Repository.new('spec/fixtures/test.git') } 11 let(:repo) { Pronto::Git::Repository.new("spec/fixtures/#{repo_name}.git") }
11 after { FileUtils.mv(dot_git, git) } 12 after { FileUtils.mv(dot_git, git) }
13 end
12end 14end
13 15
14RSpec.configure do |config| 16RSpec.configure do |config|