2009-10-11 00:44:59 +00:00
|
|
|
class JasmineHelper
|
2009-11-25 06:42:15 +00:00
|
|
|
def self.lib_dir
|
|
|
|
File.expand_path(File.join(root, 'lib'))
|
2009-10-11 00:44:59 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def self.jasmine
|
2009-11-25 06:42:15 +00:00
|
|
|
['/lib/' + File.basename(Dir.glob("#{JasmineHelper.lib_dir}/jasmine*.js").first)] +
|
2009-10-11 00:44:59 +00:00
|
|
|
['/lib/json2.js',
|
|
|
|
'/lib/TrivialReporter.js']
|
|
|
|
end
|
|
|
|
|
2009-11-25 06:42:15 +00:00
|
|
|
def self.root
|
2009-10-11 00:44:59 +00:00
|
|
|
File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'jasmine'))
|
|
|
|
end
|
|
|
|
|
2009-11-25 06:42:15 +00:00
|
|
|
def self.spec_dir
|
2009-11-25 16:01:09 +00:00
|
|
|
File.expand_path('spec')
|
2009-10-11 00:44:59 +00:00
|
|
|
end
|
|
|
|
|
2009-10-15 07:27:46 +00:00
|
|
|
def self.spec_files
|
2009-11-25 16:01:09 +00:00
|
|
|
Dir.glob(File.join(spec_dir, "javascripts/**/*[Ss]pec.js"))
|
2009-10-11 00:44:59 +00:00
|
|
|
end
|
|
|
|
|
2009-10-15 07:27:46 +00:00
|
|
|
def self.specs
|
2009-11-25 06:42:15 +00:00
|
|
|
spec_files.collect {|f| f.sub(spec_dir, "/spec")}
|
2009-10-11 00:44:59 +00:00
|
|
|
end
|
|
|
|
|
2009-11-01 05:35:35 +00:00
|
|
|
def self.spec_helpers_files
|
2009-11-25 06:42:15 +00:00
|
|
|
Dir.glob(File.join(spec_dir, "helpers/**/*.js"))
|
2009-11-01 05:35:35 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def self.spec_helpers
|
2009-11-25 06:42:15 +00:00
|
|
|
spec_helpers_files.collect {|f| f.sub(spec_dir, "/spec")}
|
2009-11-01 05:35:35 +00:00
|
|
|
end
|
|
|
|
|
2009-10-11 00:44:59 +00:00
|
|
|
def self.dir_mappings
|
|
|
|
{
|
2009-11-25 06:42:15 +00:00
|
|
|
"/spec" => spec_dir,
|
|
|
|
"/lib" => lib_dir
|
2009-10-11 00:44:59 +00:00
|
|
|
}
|
|
|
|
end
|
2009-11-25 06:42:15 +00:00
|
|
|
|
|
|
|
def self.meta_spec_path
|
2009-11-25 16:01:09 +00:00
|
|
|
File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'lib', 'jasmine-ruby', 'jasmine_meta_spec.rb'))
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.files
|
|
|
|
[]
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.stylesheets
|
|
|
|
[]
|
2009-11-25 06:42:15 +00:00
|
|
|
end
|
|
|
|
|
2009-10-11 00:44:59 +00:00
|
|
|
end
|