Skip to content

Commit 3399e5a

Browse files
committed
Fix Ruby 1.9.3 tests
1 parent 88bef7d commit 3399e5a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/spring/test/application_generator.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ def generate
3838

3939
# Sporadic SSL errors keep causing test failures so there are anti-SSL workarounds here
4040
def generate_files
41+
if RUBY_VERSION == "1.9.3"
42+
system("gem list '^mime-types$' --installed --version '~> 2' || " \
43+
"gem install mime-types --clear-sources --source http://rubygems.org --version '~> 2'")
44+
end
45+
4146
system("gem list '^rails$' --installed --version '#{version_constraint}' || " \
4247
"gem install rails --clear-sources --source http://rubygems.org --version '#{version_constraint}'")
4348

@@ -59,7 +64,7 @@ def generate_files
5964
append_to_file(application.gemfile, "gem 'spring-commands-testunit'")
6065
end
6166

62-
if RUBY_VERSION == "1.9.3"
67+
if RUBY_VERSION == "1.9.3" && version.to_s.start_with?("4.0")
6368
append_to_file(application.gemfile, "gem 'mime-types', '~> 2'")
6469
end
6570

0 commit comments

Comments
 (0)