]>
Commit | Line | Data |
---|---|---|
0ab4d181 MD |
1 | # frozen_string_literal: true |
2 | ||
2add6782 | 3 | require 'fileutils' |
a6e7dde8 | 4 | require 'byebug' |
ce89f9ed | 5 | require 'rspec' |
126fe1e2 | 6 | require 'pronto/eslint_npm' |
ce89f9ed | 7 | |
0ab4d181 | 8 | %w[test eslintignore].each do |repo_name| |
fb94b0e6 MD |
9 | RSpec.shared_context "#{repo_name} repo" do |
10 | let(:git) { "spec/fixtures/#{repo_name}.git/git" } | |
11 | let(:dot_git) { "spec/fixtures/#{repo_name}.git/.git" } | |
ce89f9ed | 12 | |
fb94b0e6 MD |
13 | before { FileUtils.mv(git, dot_git) } |
14 | let(:repo) { Pronto::Git::Repository.new("spec/fixtures/#{repo_name}.git") } | |
15 | after { FileUtils.mv(dot_git, git) } | |
16 | end | |
ce89f9ed | 17 | end |
1845f2e3 MD |
18 | |
19 | RSpec.shared_context 'with config', config: true do | |
c89a62b8 | 20 | requested_config = metadata[:config] |
1845f2e3 | 21 | |
c89a62b8 MD |
22 | before(:each) do |
23 | allow_any_instance_of(Pronto::ESLintNpm).to receive(:config_options).and_return(requested_config) | |
24 | end | |
1845f2e3 | 25 | end |