test/pelusa/lint/indentation_level_test.rb in pelusa-0.0.2 vs test/pelusa/lint/indentation_level_test.rb in pelusa-0.1.0
- old
+ new
@@ -39,9 +39,29 @@
analysis = @lint.check(klass)
analysis.failed?.must_equal true
end
end
+
+ describe "when there is method which produces nested list" do
+ it 'returns a FailureAnalysis' do
+ klass = """
+ class Foo
+ def initialize
+ if test
+ a = [
+ (1..3).map do |num|
+ num
+ end
+ ]
+ end
+ end
+ end""".to_ast
+
+ analysis = @lint.check klass
+ analysis.failed?.must_equal true
+ end
+ end
end
end
end
end