Skip to content

Commit be9e587

Browse files
committed
Merge pull request activeadmin#254 from mattvague/master
Only try to run the JS Lint test if Java is installed (the test requires Java)
2 parents ab53c03 + 0333ec0 commit be9e587

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed
Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
require 'spec_helper'
22
require 'jslint'
33

4-
describe "Javascript" do
5-
6-
before do
7-
@lint = JSLint::Lint.new(
8-
:config_path => 'spec/support/jslint.yml'
9-
)
10-
end
11-
12-
it "should not have any syntax errors" do
13-
@lint.run
4+
%x[java]
5+
if $? == 0 # Only run the JS Lint test if Java is installed
6+
describe "Javascript" do
7+
before do
8+
@lint = JSLint::Lint.new(
9+
:paths => ['public/javascripts/**/*.js'],
10+
:exclude_paths => ['public/javascripts/vendor/**/*.js'],
11+
:config_path => 'spec/support/jslint.yml'
12+
)
13+
end
14+
15+
it "should not have any syntax errors" do
16+
@lint.run
17+
end
1418
end
1519
end
20+

0 commit comments

Comments
 (0)