test/support/rails_helper.rb in active_assets-0.3.1 vs test/support/rails_helper.rb in active_assets-1.0.0.rc1
- old
+ new
@@ -10,23 +10,17 @@
FileUtils.rm_rf(dir)
end
end
def initialize_application_or_load_sprites!
- if Rails.application && initialized?
- load_sprites!
- elsif Rails.application && !initialized?
- initialize_application!
- end
+ load_sprites! if Rails.application && Rails.application.instance_variable_defined?(:@ran)
+ initialize_application! unless Rails.application && Rails.application.instance_variable_defined?(:@ran)
end
def initialize_application_or_load_expansions!
- if Rails.application && (Rails.version.to_i < 3 || Rails.application.instance_variable_defined?(:@ran))
- load_assets!
- elsif !(Rails.application && Rails.application.instance_variable_defined?(:@ran))
- initialize_application!
- end
+ load_assets! if Rails.application && Rails.application.instance_variable_defined?(:@ran)
+ initialize_application! unless Rails.application && Rails.application.instance_variable_defined?(:@ran)
end
def load_assets!
if File.exists?(File.join(rails_root, 'config/assets.rb'))
load File.join(rails_root, 'config/assets.rb')
@@ -40,14 +34,8 @@
def load_sprites!
load File.join(rails_root, 'config/sprites.rb') if File.exists?(File.join(rails_root, 'config/sprites.rb'))
end
def initialize_application!
- if Rails.version.to_i >= 3
- ActiveAssetsTest::Application.initialize!
- end
- end
-
- def initialized?
- Rails.version.to_i < 3 || Rails.application.instance_variable_defined?(:@ran)
+ ActiveAssetsTest::Application.initialize!
end
end