]>
Commit | Line | Data |
---|---|---|
2add6782 | 1 | require 'fileutils' |
ce89f9ed | 2 | require 'rspec' |
126fe1e2 | 3 | require 'pronto/eslint_npm' |
ce89f9ed | 4 | |
fb94b0e6 MD |
5 | %w(test eslintignore).each do |repo_name| |
6 | RSpec.shared_context "#{repo_name} repo" do | |
7 | let(:git) { "spec/fixtures/#{repo_name}.git/git" } | |
8 | let(:dot_git) { "spec/fixtures/#{repo_name}.git/.git" } | |
ce89f9ed | 9 | |
fb94b0e6 MD |
10 | before { FileUtils.mv(git, dot_git) } |
11 | let(:repo) { Pronto::Git::Repository.new("spec/fixtures/#{repo_name}.git") } | |
12 | after { FileUtils.mv(dot_git, git) } | |
13 | end | |
ce89f9ed | 14 | end |
1845f2e3 MD |
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 |