diff options
| author | Markus Reiter | 2016-09-24 13:52:43 +0200 |
|---|---|---|
| committer | Markus Reiter | 2016-09-24 16:00:58 +0200 |
| commit | b86c8efb79b3ed835d552c4d7416640ef10caf21 (patch) | |
| tree | 7e1edc8a8f339e4d2781f43576d40c9c79aebcdc /Library/Homebrew/cask/test/support/shared_examples.rb | |
| parent | 687f0fcf721c8e36f32570ed72d0988a6eaf986f (diff) | |
| download | brew-b86c8efb79b3ed835d552c4d7416640ef10caf21.tar.bz2 | |
Cask: Use nested classes and modules.
Diffstat (limited to 'Library/Homebrew/cask/test/support/shared_examples.rb')
| -rw-r--r-- | Library/Homebrew/cask/test/support/shared_examples.rb | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/Library/Homebrew/cask/test/support/shared_examples.rb b/Library/Homebrew/cask/test/support/shared_examples.rb index e846af404..594ca81c1 100644 --- a/Library/Homebrew/cask/test/support/shared_examples.rb +++ b/Library/Homebrew/cask/test/support/shared_examples.rb @@ -5,14 +5,18 @@ MiniTest::Spec.class_eval do end end -module MiniTest::Spec::SharedExamples - def shared_examples_for(desc, &block) - MiniTest::Spec.shared_examples[desc] = block - end +module MiniTest + class Spec + module SharedExamples + def shared_examples_for(desc, &block) + MiniTest::Spec.shared_examples[desc] = block + end - def it_behaves_like(desc, *args, &block) - instance_exec(*args, &MiniTest::Spec.shared_examples[desc]) - instance_eval(&block) if block_given? + def it_behaves_like(desc, *args, &block) + instance_exec(*args, &MiniTest::Spec.shared_examples[desc]) + instance_eval(&block) if block_given? + end + end end end |
