Skip to content
This repository was archived by the owner on Jan 24, 2025. It is now read-only.

Commit 4fe316e

Browse files
authored
Merge pull request #997 from alphagov/fix-rakefile-rubocop
Only run rubocop under development or test
2 parents 469f5a8 + f2b5664 commit 4fe316e

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

Rakefile

+8-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,14 @@
22
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
33

44
require_relative "config/application"
5-
require "rubocop/rake_task"
5+
6+
tasks = %i[spec brakeman]
7+
if Rails.env.development? || Rails.env.test?
8+
require "rubocop/rake_task"
9+
RuboCop::RakeTask.new
10+
tasks = %i[spec brakeman rubocop]
11+
end
612

713
Rails.application.load_tasks
8-
RuboCop::RakeTask.new
914

10-
task default: %i[spec brakeman rubocop]
15+
task default: tasks

spec/lib/tasks/update_organogram_filenames_spec.rb

+4-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@
3333

3434
update_organogram_filenames.replace_urls
3535

36-
expect(Link.all[0].url).to eql("https://s3-eu-west-1.amazonaws.com/datagovuk/dataset/resources/2019-06-06T11-18-26Z-organogram-senior.csv")
37-
expect(Link.all[1].url).to eql("https://s3-eu-west-1.amazonaws.com/datagovuk/dataset/resources/2019-06-06T11-18-26Z-organogram-junior.csv")
36+
expect(Link.all.length).to be(2)
37+
expect(Link.all.map(&:url)).to include(
38+
"https://s3-eu-west-1.amazonaws.com/datagovuk/dataset/resources/2019-06-06T11-18-26Z-organogram-senior.csv", "https://s3-eu-west-1.amazonaws.com/datagovuk/dataset/resources/2019-06-06T11-18-26Z-organogram-junior.csv"
39+
)
3840
end
3941
end
4042
end

0 commit comments

Comments
 (0)