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

bears.tests.coffee_script.CoffeeLintBearTest   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 29
Duplicated Lines 0 %
Metric Value
dl 0
loc 29
rs 10
wmc 6
1
from bears.coffee_script.CoffeeLintBear import CoffeeLintBear
2
from bears.tests.LocalBearTestHelper import verify_local_bear
3
4
5
good_file = """
6
# Lint your CoffeeScript!
7
8
class Gangster
9
10
  wasItAGoodDay : () ->
11
    yes
12
""".split("\n")
13
14
15
warning_file = """
16
# Nested string interpolation
17
str = "Book by #{"#{firstName} #{lastName}".toUpperCase()}"
18
""".split("\n")
19
20
21
error_file = """
22
# Wrong capitalization
23
class theGangster
24
25
  wasItAGoodDay : () ->
26
    yes
27
""".split("\n")
28
29
30
invalid_file = """
31
# Coffeelint is buggy here and will generate an error with invalid CSV on this
32
var test
33
""".split("\n")
34
35
36
CoffeeLintBear1Test = verify_local_bear(CoffeeLintBear,
37
                                        valid_files=(good_file,),
38
                                        invalid_files=(warning_file,
39
                                                       error_file,
40
                                                       invalid_file))
41