aboutsummaryrefslogtreecommitdiffhomepage
path: root/spec/spec_helper.rb
diff options
context:
space:
mode:
authorMarkus Doits <markus.doits@stellenticket.de>2016-09-11 14:49:59 +0200
committerMarkus Doits <markus.doits@stellenticket.de>2016-09-11 15:13:42 +0200
commit1845f2e31adc6f9b1513b779f44e3bd347d6fd11 (patch)
tree41d61b6b061234f0f1ccab2f86898386a3ee6bcf /spec/spec_helper.rb
parent3403f9d12247884c18ffe7a1636fe12c3fb0f0da (diff)
downloadpronto-hlint-1845f2e31adc6f9b1513b779f44e3bd347d6fd11.tar.gz
pronto-hlint-1845f2e31adc6f9b1513b779f44e3bd347d6fd11.tar.zst
pronto-hlint-1845f2e31adc6f9b1513b779f44e3bd347d6fd11.zip
Allow to set config with `.pronto_eslint_npm.yml`
Make configuration dependent on instance instead of class, too.
Diffstat (limited to 'spec/spec_helper.rb')
-rw-r--r--spec/spec_helper.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 72a128b..da4fc00 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -1,6 +1,5 @@
1require 'fileutils' 1require 'fileutils'
2require 'rspec' 2require 'rspec'
3require 'rspec/its'
4require 'pronto/eslint_npm' 3require 'pronto/eslint_npm'
5 4
6%w(test eslintignore).each do |repo_name| 5%w(test eslintignore).each do |repo_name|
@@ -13,3 +12,12 @@ require 'pronto/eslint_npm'
13 after { FileUtils.mv(dot_git, git) } 12 after { FileUtils.mv(dot_git, git) }
14 end 13 end
15end 14end
15
16RSpec.shared_context 'with config', config: true do
17 requested_config = metadata[:config].to_yaml
18
19 let(:config_path) { File.join(repo.path.to_s, Pronto::ESLintNpm::CONFIG_FILE) }
20
21 before(:each) { File.write(config_path, requested_config) }
22 after(:each) { FileUtils.rm(config_path) }
23end