Class: Object
- Inherits:
- BasicObject
- Defined in:
- lib/whats_up.rb,
lib/whats_up/classic.rb
Overview
Some credits: Code this version is based on: Andrew Birkett
http://www.nobugs.org/developer/ruby/method_finder.html
Improvements from Why’s blog entry
-
what? == - Why
-
@@blacklist - llasram
-
clone alias - Daniel Schierbeck
-
$stdout redirect - Why redhanded.hobix.com/inspect/stickItInYourIrbrcMethodfinder.html
Improvements from Nikolas Coukouma
-
Varargs and block support
-
Improved catching
-
Redirecting $stdout and $stderr (independently of Why) atrustheotaku.livejournal.com/339449.html
A version posted in 2002 by Steven Grady:
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/32844
David Tran’s versions:
-
Checks permutations of arguments www.doublegifts.com/pub/ruby/methodfinder2.rb.html
Last updated: 2006/05/20
Instance Method Summary collapse
-
#__clone__ ⇒ Object
Make sure cloning doesn’t cause anything to fail via type errors.
- #clone ⇒ Object
- #given(*args) ⇒ Object
- #what_equals(expected_result, *args, &block) ⇒ Object (also: #what?)
- #what_matches(expected_result, *args, &block) ⇒ Object (also: #matches?)
- #what_works_with(*args, &block) ⇒ Object (also: #what_works, #works?)
- #whats_exactly(expected_result, *args, &block) ⇒ Object (also: #exactly?)
- #whats_not_blank_with(*args, &block) ⇒ Object (also: #whats_not_blank, #not_blank?)
Instance Method Details
#__clone__ ⇒ Object
Make sure cloning doesn’t cause anything to fail via type errors
59 |
# File 'lib/whats_up.rb', line 59 alias_method :__clone__, :clone |
#clone ⇒ Object
60 61 62 63 64 |
# File 'lib/whats_up.rb', line 60 def clone __clone__ rescue TypeError self end |
#given(*args) ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'lib/whats_up.rb', line 27 def given(*args) if frozen? WhatsUp::FrozenSection.new self, args: args else @args = args self end end |
#what_equals(expected_result, *args, &block) ⇒ Object Also known as: what?
36 37 38 |
# File 'lib/whats_up.rb', line 36 def what_equals(expected_result, *args, &block) show_methods expected_result, {}, *args, &block end |
#what_matches(expected_result, *args, &block) ⇒ Object Also known as: matches?
44 45 46 |
# File 'lib/whats_up.rb', line 44 def what_matches(expected_result, *args, &block) show_methods expected_result, { force_regex: true }, *args, &block end |
#what_works_with(*args, &block) ⇒ Object Also known as: what_works, works?
48 49 50 |
# File 'lib/whats_up.rb', line 48 def what_works_with(*args, &block) show_methods nil, { show_all: true }, *args, &block end |
#whats_exactly(expected_result, *args, &block) ⇒ Object Also known as: exactly?
40 41 42 |
# File 'lib/whats_up.rb', line 40 def whats_exactly(expected_result, *args, &block) show_methods expected_result, { force_exact: true }, *args, &block end |
#whats_not_blank_with(*args, &block) ⇒ Object Also known as: whats_not_blank, not_blank?
53 54 55 |
# File 'lib/whats_up.rb', line 53 def whats_not_blank_with(*args, &block) show_methods nil, { show_all: true, exclude_blank: true }, *args, &block end |