Permalink
Browse files

revisit the test skipped on windows - will run on newer windows versi…

…ons now (where `where` is available)
  • Loading branch information...
1 parent 3e29a3a commit 663c7e70a725711742a5e8f2931785b0b5140689 @kares kares committed Jul 29, 2011
Showing with 9 additions and 7 deletions.
  1. +9 −7 test/unit/closure_compiler_test.rb
@@ -32,16 +32,18 @@ def test_block_syntax
end
assert result == COMPILED_ADVANCED
end
-
- unless RUBY_PLATFORM =~ /mswin|mingw/ # which won't work on windows
def test_jar_and_java_specifiation
jar = Dir['vendor/closure-compiler-*.jar'].first
- java = `which java`.strip
- compiler = Compiler.new(:java => java, :jar_file => jar)
- assert compiler.compress(ORIGINAL) == COMPILED_SIMPLE
- end
-
+ unless java = ( `which java` rescue nil )
+ java = `where java` rescue nil # works on newer windows
+ end
+ if java
+ compiler = Compiler.new(:java => java.strip, :jar_file => jar)
+ assert compiler.compress(ORIGINAL) == COMPILED_SIMPLE
+ else
+ puts "could not `which/where java` skipping test"
+ end
end
def test_exceptions

0 comments on commit 663c7e7

Please sign in to comment.