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

bears.tests.ruby.RubyLintBearTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %
Metric Value
dl 0
loc 19
rs 10
wmc 2
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