jasmine 0.10.3.3 → 0.10.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/jasmine/config.rb +2 -1
- data/spec/config_spec.rb +12 -0
- metadata +2 -2
data/lib/jasmine/config.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
module Jasmine
|
2
2
|
class Config
|
3
3
|
require 'yaml'
|
4
|
+
require 'erb'
|
4
5
|
|
5
6
|
def initialize(options = {})
|
6
7
|
require 'selenium_rc'
|
@@ -93,7 +94,7 @@ module Jasmine
|
|
93
94
|
end
|
94
95
|
|
95
96
|
def simple_config
|
96
|
-
config = File.exist?(simple_config_file) ? File.
|
97
|
+
config = File.exist?(simple_config_file) ? YAML::load(ERB.new(File.read(simple_config_file)).result(binding)) : false
|
97
98
|
config || {}
|
98
99
|
end
|
99
100
|
|
data/spec/config_spec.rb
CHANGED
@@ -51,6 +51,18 @@ describe Jasmine::Config do
|
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
54
|
+
it "should parse ERB" do
|
55
|
+
@config.stub!(:simple_config_file).and_return(File.expand_path(File.join(File.dirname(__FILE__), 'fixture/jasmine.erb.yml')))
|
56
|
+
Dir.stub!(:glob).and_return do |glob_string|
|
57
|
+
glob_string
|
58
|
+
end
|
59
|
+
@config.src_files.should == [
|
60
|
+
'file0.js',
|
61
|
+
'file1.js',
|
62
|
+
'file2.js',
|
63
|
+
]
|
64
|
+
end
|
65
|
+
|
54
66
|
|
55
67
|
describe "if sources.yaml not found" do
|
56
68
|
before(:each) do
|