better handling of rails version checks
This commit is contained in:
parent
21d93e7c9f
commit
75f4d26344
@ -42,7 +42,7 @@ module Jasmine
|
|||||||
|
|
||||||
private
|
private
|
||||||
def create_rails_compliant_task
|
def create_rails_compliant_task
|
||||||
if Rails.version >= "3.1.0"
|
if Rails.respond_to?(:version) && Rails.version >= "3.1.0"
|
||||||
desc 'Force generate static assets without an MD5 hash, all assets end with -test.<ext>'
|
desc 'Force generate static assets without an MD5 hash, all assets end with -test.<ext>'
|
||||||
task 'assets:precompile:for_testing' => :environment do
|
task 'assets:precompile:for_testing' => :environment do
|
||||||
Rails.application.assets.digest_class = Digest::JasmineTest
|
Rails.application.assets.digest_class = Digest::JasmineTest
|
||||||
|
@ -21,16 +21,32 @@ describe Jasmine::Headless::Task do
|
|||||||
end
|
end
|
||||||
|
|
||||||
context 'with Rails' do
|
context 'with Rails' do
|
||||||
before do
|
context 'without version' do
|
||||||
module Rails
|
before do
|
||||||
def self.version
|
module Rails
|
||||||
return "0"
|
def self.version
|
||||||
|
return "0"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'should be OK if rails is defined' do
|
||||||
|
Jasmine::Headless::Task.new('jasmine:headless')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should be OK if rails is defined' do
|
context 'with version' do
|
||||||
Jasmine::Headless::Task.new('jasmine:headless')
|
before do
|
||||||
|
module Rails
|
||||||
|
def self.version
|
||||||
|
return "0"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'should be OK if rails is defined' do
|
||||||
|
Jasmine::Headless::Task.new('jasmine:headless')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user