Files
jasmine/tasks/jasmine_dev/execute_specs.rb
Dan Hansen and Davis W. Frank e09fd40933 Move to grunt for building all distribution files.
* canonical version number of jasmine-core is now is package.json
* `grunt buildDistribution` builds jasmine.js, jasmine-html.js, jasmine.css and outputs them to the dist dir
* `grunt buildStandaloneDist` builds the example spec runner files and compresses them to dist/jasmine-VERSION.zip
* `grunt compass` compiles jasmine.css
* jasmine.Env handling of version is backwards compatible, but uses the version string directly (and nicely deprecated)
* Ruby/thor tasks that did the above deleted
2013-03-03 16:04:38 -08:00

55 lines
1.2 KiB
Ruby

class JasmineDev < Thor
desc "execute_specs_in_node", "Run all relevant specs in Node.js"
def execute_specs_in_node
return unless node_installed?
`grunt buildDistribution`
invoke :count_specs
say JasmineDev.spacer
say "Running all appropriate specs via Node.js...", :cyan
with_color_option = STDOUT.isatty ? "--color" : "--noColor"
run_with_output "node spec/node_suite.js #{with_color_option}", :capture => true
end
desc "execute_specs_in_browser", "Run all relevent specs in your default browser"
def execute_specs_in_browser
return unless node_installed?
`grunt buildDistribution`
invoke :count_specs
say JasmineDev.spacer
say "Running all appropriate specs via the default web browser...", :cyan
open_specs_in_browser
end
desc "execute_specs", "Run all of Jasmine's JavaScript specs"
def execute_specs
invoke :execute_specs_in_node
invoke :execute_specs_in_browser
end
no_tasks do
def open_specs_in_browser
require 'rbconfig'
case Object.const_get(defined?(RbConfig) ? :RbConfig : :Config)::CONFIG['host_os']
when /linux/
run "xdg-open spec/runner.html"
else
run "open spec/runner.html"
end
end
end
end