Commit 03f02bcf by David Baumgold

Added rake jasmine:cms:browser:watch command

parent 25aec96e
...@@ -61,10 +61,10 @@ def template_jasmine_runner(lib) ...@@ -61,10 +61,10 @@ def template_jasmine_runner(lib)
yield File.expand_path(template_output) yield File.expand_path(template_output)
end end
def jasmine_browser(url, wait=10) def jasmine_browser(url, jitter=3, wait=10)
# Jitter starting the browser so that the tests don't all try and # Jitter starting the browser so that the tests don't all try and
# start the browser simultaneously # start the browser simultaneously
sleep(rand(3)) sleep(rand(jitter))
sh("python -m webbrowser -t '#{url}'") sh("python -m webbrowser -t '#{url}'")
sleep(wait) sleep(wait)
end end
...@@ -87,6 +87,15 @@ end ...@@ -87,6 +87,15 @@ end
end end
end end
desc "Open jasmine tests for #{system} in your default browser, and dynamically recompile coffeescript"
task :'browser:watch' => :'assets:coffee:_watch' do
django_for_jasmine(system, true) do |jasmine_url|
jasmine_browser(jasmine_url, jitter=0, wait=0)
end
puts "Press ENTER to terminate".red
$stdin.gets
end
desc "Use phantomjs to run jasmine tests for #{system} from the console" desc "Use phantomjs to run jasmine tests for #{system} from the console"
task :phantomjs do task :phantomjs do
Rake::Task[:assets].invoke(system, 'jasmine') Rake::Task[:assets].invoke(system, 'jasmine')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment