Better argument handling in Jasmine::Core#spec_files

This commit is contained in:
ragaskar
2011-06-18 09:43:14 -04:00
parent 0d43ae9c38
commit e9af7834f5
3 changed files with 6 additions and 3 deletions

View File

@@ -9,6 +9,8 @@ module Jasmine
(["jasmine.js"] + Dir.glob(File.join(path, "*.js"))).map { |f| File.basename(f) }.uniq
end
SPEC_TYPES = ["core", "html", "node"]
def core_spec_files
spec_files("core")
end
@@ -22,7 +24,8 @@ module Jasmine
end
def spec_files(type)
(Dir.glob(File.join(path, "spec/#{type}/*.js"))).map { |f| File.join("spec", type, File.basename(f)) }.uniq
raise ArgumentError.new("Unrecognized spec type") unless SPEC_TYPES.include?(type)
(Dir.glob(File.join(path, "spec", type, "*.js"))).map { |f| File.join("spec", type, File.basename(f)) }.uniq
end
def css_files

View File

@@ -2472,5 +2472,5 @@ jasmine.version_= {
"major": 1,
"minor": 1,
"build": 0,
"revision": 1308358300
"revision": 1308404354
};

View File

@@ -2,5 +2,5 @@ jasmine.version_= {
"major": 1,
"minor": 1,
"build": 0,
"revision": 1308358300
"revision": 1308404354
};