1
0
Fork 0
mirror of https://github.com/thoughtbot/factory_bot_rails.git synced 2022-11-09 11:49:18 -05:00

Address todos generated by rubocop for files in Rakefile and Appraisals. (#298)

This partially addresses #293. Since rubocop generated quite a few todos, the commits addressing them are split up into a few different PRs that cover different files.
This commit is contained in:
Alex 2018-09-28 13:10:19 -05:00 committed by Daniel Colson
parent c6b66bbb1a
commit 77d707d2c7
3 changed files with 24 additions and 35 deletions

View file

@ -64,7 +64,6 @@ Lint/AmbiguousRegexpLiteral:
# Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments.
Lint/UnusedBlockArgument:
Exclude:
- 'Rakefile'
- 'features/support/env.rb'
# Offense count: 2
@ -97,7 +96,6 @@ Style/Documentation:
# SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys
Style/HashSyntax:
Exclude:
- 'Rakefile'
- 'gemfiles/rails4.2.gemfile'
- 'gemfiles/rails5.0.gemfile'
- 'gemfiles/rails5.1.gemfile'
@ -124,9 +122,7 @@ Style/PercentLiteralDelimiters:
Style/StringLiterals:
EnforcedStyle: "double_quotes"
Exclude:
- 'Appraisals'
- 'Gemfile'
- 'Rakefile'
- 'factory_bot_rails.gemspec'
- 'features/step_definitions/rails_steps.rb'
- 'features/support/env.rb'
@ -169,10 +165,3 @@ Style/WordArray:
# URISchemes: http, https
Metrics/LineLength:
Max: 133
# Offense count: 1
# Cop supports --auto-correct.
Performance/RegexpMatch:
Exclude:
- 'Rakefile'

View file

@ -1,19 +1,19 @@
# These are the versions of Rails we want to test against.
appraise 'rails4.2' do
gem 'rails', '~> 4.2.0'
appraise "rails4.2" do
gem "rails", "~> 4.2.0"
end
appraise 'rails5.0' do
gem 'activerecord', '~> 5.0.0'
gem 'railties', '~> 5.0.0'
appraise "rails5.0" do
gem "activerecord", "~> 5.0.0"
gem "railties", "~> 5.0.0"
end
appraise 'rails5.1' do
gem 'activerecord', '~> 5.1.0'
gem 'railties', '~> 5.1.0'
appraise "rails5.1" do
gem "activerecord", "~> 5.1.0"
gem "railties", "~> 5.1.0"
end
appraise 'rails5.2' do
gem 'activerecord', '~> 5.2.0'
gem 'railties', '~> 5.2.0'
appraise "rails5.2" do
gem "activerecord", "~> 5.2.0"
gem "railties", "~> 5.2.0"
end

View file

@ -1,27 +1,27 @@
require 'bundler/setup'
require 'cucumber/rake/task'
require 'rspec/core/rake_task'
require "bundler/setup"
require "cucumber/rake/task"
require "rspec/core/rake_task"
Bundler::GemHelper.install_tasks name: 'factory_bot_rails'
Bundler::GemHelper.install_tasks name: "factory_bot_rails"
Cucumber::Rake::Task.new(:cucumber) do |t|
t.fork = true
t.cucumber_opts = ['--format', (ENV['CUCUMBER_FORMAT'] || 'progress')]
t.cucumber_opts = ["--format", (ENV["CUCUMBER_FORMAT"] || "progress")]
end
RSpec::Core::RakeTask.new(:spec)
require 'appraisal'
require "appraisal"
desc 'Run the test suite'
task :default do |t|
if ENV['BUNDLE_GEMFILE'] =~ /gemfiles/
exec 'rake spec && rake cucumber'
desc "Run the test suite"
task :default do
if ENV["BUNDLE_GEMFILE"] =~ /gemfiles/
exec "rake spec && rake cucumber"
else
Rake::Task['appraise'].execute
Rake::Task["appraise"].execute
end
end
task :appraise => ['appraisal:install'] do |t|
exec 'rake appraisal'
task appraise: ["appraisal:install"] do
exec "rake appraisal"
end