Created
November 21, 2009 21:51
-
-
Save okitan/240294 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Spec | |
module Example | |
class ExampleGroupMethods | |
def run_examples(success, instance_variables, examples, run_options) | |
return [success, instance_variables] unless success | |
after_all_instance_variables = instance_variables | |
examples.each do |example| | |
example_group_instance = new(example, &example_implementations[example]) | |
success &= example_group_instance.execute(run_options, instance_variables.update(:@_success => success)) | |
after_all_instance_variables = example_group_instance.instance_variable_hash | |
end | |
return [success, after_all_instance_variables] | |
end | |
def _and_(description=nil, options={}, backtrace=nil, &implementation) | |
example(", and " << description, options, backtrace) do | |
@_success ? instance_eval(&implementation) : pending 'skipped due to previous failure' | |
end | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment