blob: 57457b7b4e9fadde3390fa6cb70bc1ef01d53099 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
#!/usr/bin/ruby -rubygems
require 'test/unit'
#
# This test is skipped if we cannot load the rubocop-gem.
#
class TestRubocop < Test::Unit::TestCase
def setup
end
def teardown
end
def test_code
begin
require 'rubocop'
cli = RuboCop::CLI.new
result = cli.run
assert(result == 0, 'No errors found')
rescue LoadError => ex
if methods.include?(:skip)
skip("Failed to load 'rubocop' gem - skipping")
else
omit("Failed to load 'rubocop' gem - skipping")
end
end
end
end
|