jasmine/lib/jasmine-ruby/jasmine_helper.rb

56 lines
1.1 KiB
Ruby
Raw Normal View History

2009-10-11 00:44:59 +00:00
class JasmineHelper
def self.lib_dir
File.expand_path(File.join(root, 'lib'))
2009-10-11 00:44:59 +00:00
end
def self.jasmine
['/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
def self.root
2009-10-11 00:44:59 +00:00
File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'jasmine'))
end
def self.spec_dir
File.expand_path('spec')
2009-10-11 00:44:59 +00:00
end
def self.spec_files
Dir.glob(File.join(spec_dir, "javascripts/**/*[Ss]pec.js"))
2009-10-11 00:44:59 +00:00
end
def self.specs
spec_files.collect {|f| f.sub(spec_dir, "/spec")}
2009-10-11 00:44:59 +00:00
end
def self.spec_helpers_files
Dir.glob(File.join(spec_dir, "helpers/**/*.js"))
end
def self.spec_helpers
spec_helpers_files.collect {|f| f.sub(spec_dir, "/spec")}
end
2009-10-11 00:44:59 +00:00
def self.dir_mappings
{
"/spec" => spec_dir,
"/lib" => lib_dir
2009-10-11 00:44:59 +00:00
}
end
def self.meta_spec_path
File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'lib', 'jasmine-ruby', 'jasmine_meta_spec.rb'))
end
def self.files
[]
end
def self.stylesheets
[]
end
2009-10-11 00:44:59 +00:00
end