2011-09-01 13:38:53 +00:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe Jasmine::Headless::CoffeeScriptCache do
|
|
|
|
include FakeFS::SpecHelpers
|
|
|
|
|
2011-09-01 14:39:29 +00:00
|
|
|
describe '#action' do
|
|
|
|
let(:file) { 'file' }
|
|
|
|
let(:data) { 'data' }
|
|
|
|
let(:compiled) { 'compiled' }
|
|
|
|
|
|
|
|
before do
|
|
|
|
CoffeeScript.expects(:compile).with(data).returns(compiled)
|
|
|
|
File.open(file, 'wb') { |fh| fh.print(data) }
|
2011-09-01 13:38:53 +00:00
|
|
|
end
|
|
|
|
|
2011-09-01 14:39:29 +00:00
|
|
|
it 'should compile coffeescript' do
|
|
|
|
described_class.new(file).action.should == compiled
|
2011-09-01 13:38:53 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|