diff options
author | Markus Doits <markus.doits@stellenticket.de> | 2016-07-25 14:36:23 +0200 |
---|---|---|
committer | Markus Doits <markus.doits@stellenticket.de> | 2016-07-25 14:51:26 +0200 |
commit | fb94b0e6df4da3026b9fb4714ee7ceab6bbfa9bc (patch) | |
tree | 57d22b50d28eab271a8db6fe201a7f18bbe069f4 /spec/spec_helper.rb | |
parent | 604e30d99fdbb7c822efe31d05a0238064220037 (diff) | |
download | pronto-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.rb | 14 |
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' | |||
2 | require 'rspec/its' | 2 | require 'rspec/its' |
3 | require 'pronto/eslint' | 3 | require 'pronto/eslint' |
4 | 4 | ||
5 | RSpec.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 | ||
12 | end | 14 | end |
13 | 15 | ||
14 | RSpec.configure do |config| | 16 | RSpec.configure do |config| |