Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SignalException diasallows fail methods on any class #2161

Closed
gowabash opened this issue Aug 19, 2015 · 3 comments
Closed

SignalException diasallows fail methods on any class #2161

gowabash opened this issue Aug 19, 2015 · 3 comments
Labels

Comments

@gowabash
Copy link

Signal Exception does not care the type of class that uses the method. This should only fire when using Exception.fail (or a subclass)

EX.

class Test
  def fail
    puts "reporting the failure somewhere"
  end
end

t = Test.new
t.fail
@jonas054
Copy link
Collaborator

But SignalException doesn't report any offenses for you example! Can you change it to illustrate your point?

@gowabash
Copy link
Author

Sorry. We have an additional rule

Style/SignalException:
  EnforcedStyle: only_raise

That appears to be the cause.

@jonas054 jonas054 added the bug label Aug 27, 2015
@jonas054
Copy link
Collaborator

Yes, t.fail should not have been reported by Style/SignalException since there's an explicit receiver.

@bbatsov bbatsov closed this as completed in 5922932 Sep 7, 2015
bbatsov added a commit that referenced this issue Sep 7, 2015
[Fix #2161] Explicit receiver in SignalException
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants