Completed
Pull Request — master (#1431)
by Abdeali
01:31
created

bears.tests.ruby.RubyLintBearTest.test_run()   A

Complexity

Conditions 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %
Metric Value
cc 1
dl 0
loc 6
rs 9.4285
1
from bears.ruby.RubyLintBear import RubyLintBear
2
from bears.tests.LocalBearTestHelper import verify_local_bear
3
4
5
good_file = """
6
class HelloWorld
7
    def initialize(name)
8
        @name = name.capitalize
9
    end
10
    def sayHi
11
        puts "Hello #{@name}!"
12
    end
13
end
14
""".split("\n")
15
16
17
bad_file = """
18
class HelloWorld
19
    def initialize(name)
20
        @name = name.capitalize
21
    end
22
    def sayHi
23
        x = 1 # unused variables invoke a warning
24
        puts "Hello #{@name}!"
25
    end
26
"""
27
28
29
RubyLintBearTest = verify_local_bear(RubyLintBear,
30
                                     valid_files=(good_file,),
31
                                     invalid_files=(bad_file,))
32