Module: Jasmine::Core

Defined in:
lib/jasmine/lib/jasmine-core.rb,
lib/jasmine/lib/jasmine-core/version.rb

Constant Summary collapse

SPEC_TYPES =
["core", "html", "node"]
VERSION =
"1.3.1"

Class Method Summary collapse

Class Method Details

.core_spec_filesObject


14
15
16
# File 'lib/jasmine/lib/jasmine-core.rb', line 14

def core_spec_files
  spec_files("core")
end

.css_filesObject


31
32
33
# File 'lib/jasmine/lib/jasmine-core.rb', line 31

def css_files
  Dir.glob(File.join(path, "*.css")).map { |f| File.basename(f) }
end

.html_spec_filesObject


18
19
20
# File 'lib/jasmine/lib/jasmine-core.rb', line 18

def html_spec_files
  spec_files("html")
end

.js_filesObject


8
9
10
# File 'lib/jasmine/lib/jasmine-core.rb', line 8

def js_files
  (["jasmine.js"] + Dir.glob(File.join(path, "*.js"))).map { |f| File.basename(f) }.uniq
end

.node_spec_filesObject


22
23
24
# File 'lib/jasmine/lib/jasmine-core.rb', line 22

def node_spec_files
  spec_files("node")
end

.pathObject


4
5
6
# File 'lib/jasmine/lib/jasmine-core.rb', line 4

def path
  File.join(File.dirname(__FILE__), "jasmine-core")
end

.spec_files(type) ⇒ Object

Raises:

  • (ArgumentError)

26
27
28
29
# File 'lib/jasmine/lib/jasmine-core.rb', line 26

def spec_files(type)
  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