rspec/rules/S1186/ruby/rule.adoc

57 lines
950 B
Plaintext
Raw Normal View History

== Why is this an issue?
:operationName: method
include::../description.adoc[]
== How to fix it
=== Code examples
==== Noncompliant code example
[source,ruby,diff-id=1,diff-type=noncompliant]
----
def shouldNotBeEmpty() # Noncompliant - method is empty
end
def notImplemented() # Noncompliant - method is empty
end
def emptyOnPurpose() # Noncompliant - method is empty
end
----
==== Compliant solution
[source,ruby,diff-id=1,diff-type=compliant]
----
def shouldNotBeEmpty()
doSomething()
end
def notImplemented()
raise NotImplementedError, 'notImplemented() cannot be performed because ...'
end
def emptyOnPurpose()
# comment explaining why the method is empty
end
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
'''
== Comments And Links
(visible only on this page)
include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]