]> git.immae.eu Git - github/fretlink/pronto-hlint.git/blame - spec/spec_helper.rb
only require byebug in specs
[github/fretlink/pronto-hlint.git] / spec / spec_helper.rb
CommitLineData
2add6782 1require 'fileutils'
a6e7dde8 2require 'byebug'
ce89f9ed 3require 'rspec'
126fe1e2 4require 'pronto/eslint_npm'
ce89f9ed 5
fb94b0e6
MD
6%w(test eslintignore).each do |repo_name|
7 RSpec.shared_context "#{repo_name} repo" do
8 let(:git) { "spec/fixtures/#{repo_name}.git/git" }
9 let(:dot_git) { "spec/fixtures/#{repo_name}.git/.git" }
ce89f9ed 10
fb94b0e6
MD
11 before { FileUtils.mv(git, dot_git) }
12 let(:repo) { Pronto::Git::Repository.new("spec/fixtures/#{repo_name}.git") }
13 after { FileUtils.mv(dot_git, git) }
14 end
ce89f9ed 15end
1845f2e3
MD
16
17RSpec.shared_context 'with config', config: true do
18 requested_config = metadata[:config].to_yaml
19
20 let(:config_path) { File.join(repo.path.to_s, Pronto::ESLintNpm::CONFIG_FILE) }
21
22 before(:each) { File.write(config_path, requested_config) }
23 after(:each) { FileUtils.rm(config_path) }
24end