Commit 2beb3a43 authored by Sebastian Wiesner's avatar Sebastian Wiesner

Refactor Ruby test cases

Delete some redundant test cases for options
parent 39c2d32a
......@@ -4603,39 +4603,33 @@ Why not:
(flycheck-ert-def-checker-test ruby-rubocop ruby syntax-error
(flycheck-ert-should-syntax-check
"checkers/ruby-syntax-error.rb" 'ruby-mode
"language/ruby/syntax-error.rb" 'ruby-mode
'(5 7 error "unexpected token tCONSTANT" :checker ruby-rubocop)
'(5 24 error "unterminated string meets end of file" :checker ruby-rubocop)))
(flycheck-ert-def-checker-test ruby-rubylint ruby syntax-error
(let ((flycheck-disabled-checkers '(ruby-rubocop)))
(flycheck-ert-should-syntax-check
"checkers/ruby-syntax-error.rb" 'ruby-mode
"language/ruby/syntax-error.rb" 'ruby-mode
'(5 7 error "unexpected token tCONSTANT" :checker ruby-rubylint))))
(flycheck-ert-def-checker-test ruby ruby syntax-error
(let ((flycheck-disabled-checkers '(ruby-rubocop ruby-rubylint)))
(flycheck-ert-should-syntax-check
"checkers/ruby-syntax-error.rb" 'ruby-mode
"language/ruby/syntax-error.rb" 'ruby-mode
'(4 nil warning "assigned but unused variable - days" :checker ruby)
'(5 nil error "syntax error, unexpected tCONSTANT, expecting end-of-input"
:checker ruby))))
(flycheck-ert-def-checker-test ruby-jruby ruby syntax-error
:expected-result '(or (satisfies (lambda (result)
(and (flycheck-ert-travis-ci-p)
(ert-test-failed-p result))))
:passed)
(let ((flycheck-disabled-checkers '(ruby-rubocop ruby-rubylint ruby)))
(flycheck-ert-should-syntax-check
"checkers/ruby-syntax-error.rb" 'ruby-mode
"language/ruby/syntax-error.rb" 'ruby-mode
'(5 nil error "syntax error, unexpected tCONSTANT" :checker ruby-jruby))))
(flycheck-ert-def-checker-test (ruby-rubocop ruby-rubylint) ruby with-rubylint
(flycheck-ert-should-syntax-check
"checkers/ruby-warnings.rb" 'ruby-mode
'(1 1 info "Use snake_case for source file names." :id "Style/FileName"
:checker ruby-rubocop)
"language/ruby/warnings.rb" 'ruby-mode
'(3 1 info "Missing top-level class documentation comment."
:id "Style/Documentation" :checker ruby-rubocop)
'(5 5 warning "unused local variable arr" :checker ruby-rubylint)
......@@ -4656,61 +4650,18 @@ Why not:
'(16 1 error "wrong number of arguments (expected 2..3 but got 0)"
:checker ruby-rubylint)))
(flycheck-ert-def-checker-test ruby-rubocop ruby disabled-warning
(let ((flycheck-rubocoprc "rubocop.yml")
(flycheck-disabled-checkers '(ruby-rubylint)))
(flycheck-ert-should-syntax-check
"checkers/ruby-warnings.rb" 'ruby-mode
'(1 1 info "Use snake_case for source file names."
:id "Style/FileName" :checker ruby-rubocop)
'(3 1 info "Missing top-level class documentation comment."
:id "Style/Documentation" :checker ruby-rubocop)
'(5 5 warning "Useless assignment to variable - `arr`."
:id "Lint/UselessAssignment" :checker ruby-rubocop)
'(6 10 info "Prefer single-quoted strings when you don't need string interpolation or special symbols."
:id "Style/StringLiterals" :checker ruby-rubocop)
'(10 5 info "Use a guard clause instead of wrapping the code inside a conditional expression."
:id "Style/GuardClause" :checker ruby-rubocop)
'(10 8 warning "Literal `true` appeared in a condition."
:id "Lint/LiteralInCondition" :checker ruby-rubocop)
'(10 13 info "Do not use `then` for multi-line `if`."
:id "Style/MultilineIfThen" :checker ruby-rubocop))))
(flycheck-ert-def-checker-test ruby-rubocop ruby lint-only
(let ((flycheck-rubocop-lint-only t)
(flycheck-disabled-checkers '(ruby-rubylint)))
(flycheck-ert-should-syntax-check
"checkers/ruby-warnings.rb" 'ruby-mode
'(5 5 warning "Useless assignment to variable - `arr`."
:id "Lint/UselessAssignment" :checker ruby-rubocop)
'(10 8 warning "Literal `true` appeared in a condition."
:id "Lint/LiteralInCondition" :checker ruby-rubocop))))
(flycheck-ert-def-checker-test ruby-rubylint ruby errors-only
(let ((flycheck-disabled-checkers '(ruby-rubocop))
(flycheck-rubylintrc "rubylint.yml"))
(flycheck-ert-should-syntax-check
"checkers/ruby-warnings.rb" 'ruby-mode
'(11 24 error "undefined instance variable @name" :checker ruby-rubylint)
'(16 1 error "wrong number of arguments (expected 2..3 but got 0)"
:checker ruby-rubylint))))
(flycheck-ert-def-checker-test ruby ruby warnings
(let ((flycheck-disabled-checkers '(ruby-rubocop ruby-rubylint)))
(flycheck-ert-should-syntax-check
"checkers/ruby-warnings.rb" 'ruby-mode
"language/ruby/warnings.rb" 'ruby-mode
'(5 nil warning "assigned but unused variable - arr" :checker ruby)
'(16 nil warning "possibly useless use of == in void context"
:checker ruby))))
(flycheck-ert-def-checker-test ruby-jruby ruby ()
:expected-result '(or (satisfies (lambda (result)
(and (flycheck-ert-travis-ci-p)
(ert-test-failed-p result))))
:passed)
(let ((flycheck-disabled-checkers '(ruby-rubocop ruby-rubylint ruby)))
(flycheck-ert-should-syntax-check
"checkers/ruby-warnings.rb" 'ruby-mode
"language/ruby/warnings.rb" 'ruby-mode
'(16 nil warning "Useless use of == in void context."
:checker ruby-jruby))))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment