Skip to content

Instantly share code, notes, and snippets.

@okitan
Created November 21, 2009 21:51
Show Gist options
  • Save okitan/240294 to your computer and use it in GitHub Desktop.
Save okitan/240294 to your computer and use it in GitHub Desktop.
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