Merge branch 'master' of github.com:johnbintz/jasmine-headless-webkit

This commit is contained in:
John Bintz 2011-12-24 10:12:44 -05:00
commit 9ff0dca191
2 changed files with 7 additions and 2 deletions

View File

@ -4,6 +4,7 @@ require 'coffee-script'
require 'rainbow' require 'rainbow'
require 'yaml' require 'yaml'
require 'erb'
require 'sprockets' require 'sprockets'
@ -112,7 +113,7 @@ module Jasmine
def jasmine_config_data def jasmine_config_data
raise JasmineConfigNotFound.new("Jasmine config not found. I tried #{@options[:jasmine_config]}.") if !File.file?(@options[:jasmine_config]) raise JasmineConfigNotFound.new("Jasmine config not found. I tried #{@options[:jasmine_config]}.") if !File.file?(@options[:jasmine_config])
YAML.load_file(@options[:jasmine_config]) YAML.load(ERB.new(File.read(@options[:jasmine_config])).result(binding))
end end
end end
end end

View File

@ -37,13 +37,17 @@ describe Jasmine::Headless::Runner do
context 'file exists' do context 'file exists' do
before do before do
File.open(Jasmine::Headless::Runner::RUNNER, 'w') File.open(Jasmine::Headless::Runner::RUNNER, 'w')
File.open(config_filename, 'w') { |fh| fh.print YAML.dump('test' => 'hello') } File.open(config_filename, 'w') { |fh| fh.print YAML.dump('test' => 'hello', 'erb' => '<%= "erb" %>') }
end end
it 'should load the jasmine config' do it 'should load the jasmine config' do
runner.jasmine_config['test'].should == 'hello' runner.jasmine_config['test'].should == 'hello'
runner.jasmine_config['spec_dir'].should == 'spec/javascripts' runner.jasmine_config['spec_dir'].should == 'spec/javascripts'
end end
it 'should execute ERB in the config file' do
runner.jasmine_config['erb'].should == 'erb'
end
end end
context 'file does not exist' do context 'file does not exist' do