2011-06-28 08:25:32 +00:00
|
|
|
require 'spec_helper'
|
|
|
|
require 'fakefs/spec_helpers'
|
|
|
|
require 'jasmine/headless/task'
|
|
|
|
|
|
|
|
module Jasmine
|
|
|
|
module Headless
|
|
|
|
class Task
|
|
|
|
def desc(block)
|
|
|
|
end
|
|
|
|
def task(block)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
describe Jasmine::Headless::Task do
|
|
|
|
it 'should not explode when Rails is undefined' do
|
2011-06-28 08:49:31 +00:00
|
|
|
Object.send(:remove_const, :Rails) if defined?(Rails)
|
|
|
|
Jasmine::Headless::Task.new('jasmine:headless') do |t|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
it 'should be OK if rails is defined' do
|
|
|
|
module Rails
|
|
|
|
def self.version
|
|
|
|
return "0"
|
|
|
|
end
|
|
|
|
end
|
2011-06-28 08:25:32 +00:00
|
|
|
Jasmine::Headless::Task.new('jasmine:headless') do |t|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|