From 343fd6f84bc277106e68d8daab93d4203756c2e0 Mon Sep 17 00:00:00 2001 From: John Bintz Date: Tue, 28 Jun 2011 10:30:41 -0400 Subject: [PATCH] rearrange the furniture on the Rake task test a little bit --- spec/lib/jasmine/headless/task_spec.rb | 31 +++++++++++++++++--------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/spec/lib/jasmine/headless/task_spec.rb b/spec/lib/jasmine/headless/task_spec.rb index e31a8dd..bf21d14 100644 --- a/spec/lib/jasmine/headless/task_spec.rb +++ b/spec/lib/jasmine/headless/task_spec.rb @@ -5,26 +5,35 @@ require 'jasmine/headless/task' module Jasmine module Headless class Task - def desc(block) - end - def task(block) - end + 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 + after do Object.send(:remove_const, :Rails) if defined?(Rails) - Jasmine::Headless::Task.new('jasmine:headless') do |t| + end + + context 'without Rails' do + it 'should not explode when Rails is undefined' do + Jasmine::Headless::Task.new('jasmine:headless') end end - it 'should be OK if rails is defined' do - module Rails - def self.version - return "0" + + context 'with Rails' do + before do + module Rails + def self.version + return "0" + end end end - Jasmine::Headless::Task.new('jasmine:headless') do |t| + + it 'should be OK if rails is defined' do + Jasmine::Headless::Task.new('jasmine:headless') end end end +