Skip to content

Commit

Permalink
Better argument handling in Jasmine::Core#spec_files
Browse files Browse the repository at this point in the history
  • Loading branch information
ragaskar committed Jun 18, 2011
1 parent 0d43ae9 commit e9af783
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion lib/jasmine-core.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/jasmine-core/jasmine.js
Original file line number Diff line number Diff line change
Expand Up @@ -2472,5 +2472,5 @@ jasmine.version_= {
"major": 1,
"minor": 1,
"build": 0,
"revision": 1308358300
"revision": 1308404354
};
2 changes: 1 addition & 1 deletion src/version.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.