Skip to content

Commit

Permalink
Fix app specs
Browse files Browse the repository at this point in the history
  • Loading branch information
comandeo-mongo committed Sep 20, 2024
1 parent 58c5087 commit c289aa5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions spec/integration/app_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def clone_application(repo_url, subdir: nil)
FileUtils.rm_rf(File.basename(repo_url))
check_call(%w(git clone) + [repo_url])
Dir.chdir(File.join(*[File.basename(repo_url), subdir].compact)) do
adjust_app_gemfile
adjust_app_gemfile(add_sprockets: false)
adjust_rails_defaults
check_call(%w(bundle install), env: clean_env)
puts `git diff`
Expand Down Expand Up @@ -262,12 +262,12 @@ def write_mongoid_yml
end
end

def adjust_app_gemfile(rails_version: SpecConfig.instance.rails_version)
def adjust_app_gemfile(rails_version: SpecConfig.instance.rails_version, add_sprockets: true)
remove_bundler_req

gemfile_lines = IO.readlines('Gemfile')
gemfile_lines.delete_if do |line|
line =~ /mongoid/ || line =~ /sprockets/
line =~ /mongoid/
end
gemfile_lines << "gem 'mongoid', path: '#{File.expand_path(BASE)}'\n"
if rails_version
Expand All @@ -280,7 +280,7 @@ def adjust_app_gemfile(rails_version: SpecConfig.instance.rails_version)
gemfile_lines << "gem 'rails', '~> #{rails_version}.0'\n"
end
end
gemfile_lines << "gem 'sprockets-rails'\n"
gemfile_lines << "gem 'sprockets-rails'\n" if add_sprockets
File.open('Gemfile', 'w') do |f|
f << gemfile_lines.join
end
Expand Down

0 comments on commit c289aa5

Please sign in to comment.