Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Better argument handling in Jasmine::Core#spec_files

  • Loading branch information...
commit e9af7834f5bba1aad9a7652e4aec66aeb28caad1 1 parent 0d43ae9
@ragaskar ragaskar authored
View
5 lib/jasmine-core.rb
@@ -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
View
2  lib/jasmine-core/jasmine.js
@@ -2472,5 +2472,5 @@ jasmine.version_= {
"major": 1,
"minor": 1,
"build": 0,
- "revision": 1308358300
+ "revision": 1308404354
};
View
2  src/version.js
@@ -2,5 +2,5 @@ jasmine.version_= {
"major": 1,
"minor": 1,
"build": 0,
- "revision": 1308358300
+ "revision": 1308404354
};
Please sign in to comment.
Something went wrong with that request. Please try again.