From 94a153ed1505bb60c441d219b23289df7454c491 Mon Sep 17 00:00:00 2001 From: Dane O'Connor Date: Tue, 3 Jan 2012 17:12:20 -0500 Subject: [PATCH] add linux support to `rake spec:browser` --- tasks/spec.rb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tasks/spec.rb b/tasks/spec.rb index 2760e00d..ac496d6f 100644 --- a/tasks/spec.rb +++ b/tasks/spec.rb @@ -9,10 +9,17 @@ task "spec:node" => [:count_specs, :require_node] do system("node spec/node_suite.js #{color}") end -desc "Run specs in the default browser (MacOS only)" +desc "Run specs in the default browser (MacOS, Linux)" task "spec:browser" => [:count_specs, :build_runner_html] do puts "Running all appropriate specs via the default web browser".cyan - system("open spec/runner.html") + + require 'rbconfig' + case Object.const_get(defined?(RbConfig) ? :RbConfig : :Config)::CONFIG['host_os'] + when /linux/ + system("xdg-open spec/runner.html") + else + system("open spec/runner.html") + end end #Count number of specs in Jasmine core