Module: Spinach
- Defined in:
- lib/spinach.rb,
lib/spinach/cli.rb,
lib/spinach/dsl.rb,
lib/spinach/step.rb,
lib/spinach/hooks.rb,
lib/spinach/config.rb,
lib/spinach/parser.rb,
lib/spinach/runner.rb,
lib/spinach/feature.rb,
lib/spinach/support.rb,
lib/spinach/version.rb,
lib/spinach/capybara.rb,
lib/spinach/hookable.rb,
lib/spinach/reporter.rb,
lib/spinach/scenario.rb,
lib/spinach/background.rb,
lib/spinach/exceptions.rb,
lib/spinach/generators.rb,
lib/spinach/feature_steps.rb,
lib/spinach/parser/visitor.rb,
lib/spinach/reporter/stdout.rb,
lib/spinach/runner/feature_runner.rb,
lib/spinach/runner/scenario_runner.rb,
lib/spinach/generators/step_generator.rb,
lib/spinach/generators/feature_generator.rb,
lib/spinach/reporter/stdout/error_reporting.rb
Overview
Spinach is a BDD framework leveraging the great Gherkin language. This language is the one used defining features in Cucumber, the BDD framework Spinach is inspired upon.
Its main design goals are:
* No magic: All features are implemented using normal Ruby classes.
* Reusability: Steps are methods, so they can be reused using modules, a
common, normal practice among rubyists.
* Proper encapsulation: No conflicts between steps from different
scenarios.
Defined Under Namespace
Modules: DSL, Generators, Hookable, Support Classes: Background, Cli, Config, Feature, FeatureSteps, Hooks, Parser, Reporter, Runner, Scenario, Step, StepNotDefinedException
Constant Summary collapse
- VERSION =
Spinach version.
"0.3.0"
- @@feature_steps =
[]
Class Method Summary collapse
-
.config ⇒ Config
Accesses spinach config.
-
.feature_steps ⇒ Array<FeatureSteps>
All the registered features.
-
.find_step_definitions(name) ⇒ StepDefinitions
Finds step definitions given a feature name.
-
.hooks ⇒ Object
Returns a new hook object that will receive all the messages from the run and fire up the appropiate callbacks when needed.
-
.reset_feature_steps ⇒ Object
Resets Spinach to a pristine state, as if no feature was ever registered.
Class Method Details
.config ⇒ Config
Accesses spinach config. Allows you to configure several runtime options, like the step definitions path.
15 16 17 |
# File 'lib/spinach/config.rb', line 15 def self.config @config ||= Config.new end |
.feature_steps ⇒ Array<FeatureSteps>
Returns All the registered features.
39 40 41 |
# File 'lib/spinach.rb', line 39 def self.feature_steps @@feature_steps end |
.find_step_definitions(name) ⇒ StepDefinitions
Finds step definitions given a feature name.
67 68 69 70 71 72 73 |
# File 'lib/spinach.rb', line 67 def self.find_step_definitions(name) klass = Spinach::Support.camelize(name) feature_steps.detect do |feature| feature.feature_name.to_s == name.to_s || feature.name == klass end end |
.hooks ⇒ Object
Returns a new hook object that will receive all the messages from the run and fire up the appropiate callbacks when needed.
54 55 56 |
# File 'lib/spinach.rb', line 54 def self.hooks @@hooks ||= Hooks.new end |
.reset_feature_steps ⇒ Object
Resets Spinach to a pristine state, as if no feature was ever registered. Mostly useful in Spinach’s own testing.
47 48 49 |
# File 'lib/spinach.rb', line 47 def self.reset_feature_steps @@feature_steps = [] end |