Permalink
Browse files

Better argument handling in Jasmine::Core#spec_files

  • Loading branch information...
1 parent 0d43ae9 commit e9af7834f5bba1aad9a7652e4aec66aeb28caad1 @ragaskar ragaskar committed Jun 18, 2011
Showing with 6 additions and 3 deletions.
  1. +4 −1 lib/jasmine-core.rb
  2. +1 −1 lib/jasmine-core/jasmine.js
  3. +1 −1 src/version.js
View
@@ -9,6 +9,8 @@ def js_files
(["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 @@ def node_spec_files
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
@@ -2472,5 +2472,5 @@ jasmine.version_= {
"major": 1,
"minor": 1,
"build": 0,
- "revision": 1308358300
+ "revision": 1308404354
};
View
@@ -2,5 +2,5 @@ jasmine.version_= {
"major": 1,
"minor": 1,
"build": 0,
- "revision": 1308358300
+ "revision": 1308404354
};

0 comments on commit e9af783

Please sign in to comment.