diff options
author | Markus Doits <markus.doits@stellenticket.de> | 2016-09-11 14:49:59 +0200 |
---|---|---|
committer | Markus Doits <markus.doits@stellenticket.de> | 2016-09-11 15:13:42 +0200 |
commit | 1845f2e31adc6f9b1513b779f44e3bd347d6fd11 (patch) | |
tree | 41d61b6b061234f0f1ccab2f86898386a3ee6bcf /spec/spec_helper.rb | |
parent | 3403f9d12247884c18ffe7a1636fe12c3fb0f0da (diff) | |
download | pronto-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.rb | 10 |
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 @@ | |||
1 | require 'fileutils' | 1 | require 'fileutils' |
2 | require 'rspec' | 2 | require 'rspec' |
3 | require 'rspec/its' | ||
4 | require 'pronto/eslint_npm' | 3 | require '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 |
15 | end | 14 | end |
15 | |||
16 | RSpec.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) } | ||
23 | end | ||