--- !ruby/object:RI::ClassDescription 
attributes: []

class_methods: 
- !ruby/object:RI::MethodSummary 
  name: configure
comment: 
- !ruby/struct:SM::Flow::H 
  level: 2
  text: ExampleGroups and Examples
- !ruby/struct:SM::Flow::P 
  body: Rather than expressing examples in classes, RSpec uses a custom DSLL (DSL light) to describe groups of examples.
- !ruby/struct:SM::Flow::P 
  body: A ExampleGroup is the equivalent of a fixture in xUnit-speak. It is a metaphor for the context in which you will run your executable example - a set of known objects in a known starting state. We begin be describing
- !ruby/struct:SM::Flow::VERB 
  body: "  describe Account do\n\n    before do\n      @account = Account.new\n    end\n\n    it &quot;should have a balance of $0&quot; do\n      @account.balance.should == Money.new(0, :dollars)\n    end\n\n  end\n"
- !ruby/struct:SM::Flow::P 
  body: "We use the before block to set up the Example (given), and then the #it method to hold the example code that expresses the event (when) and the expected outcome (then)."
- !ruby/struct:SM::Flow::H 
  level: 2
  text: Helper Methods
- !ruby/struct:SM::Flow::P 
  body: A primary goal of RSpec is to keep the examples clear. We therefore prefer less indirection than you might see in xUnit examples and in well factored, DRY production code. We feel that duplication is OK if removing it makes it harder to understand an example without having to look elsewhere to understand its context.
- !ruby/struct:SM::Flow::P 
  body: That said, RSpec does support some level of encapsulating common code in helper methods that can exist within a context or within an included module.
- !ruby/struct:SM::Flow::H 
  level: 2
  text: Setup and Teardown
- !ruby/struct:SM::Flow::P 
  body: You can use before and after within a Example. Both methods take an optional scope argument so you can run the block before :each example or before :all examples
- !ruby/struct:SM::Flow::VERB 
  body: "  describe &quot;...&quot; do\n    before :all do\n      ...\n    end\n\n    before :each do\n      ...\n    end\n\n    it &quot;should do something&quot; do\n      ...\n    end\n\n    it &quot;should do something else&quot; do\n      ...\n    end\n\n    after :each do\n      ...\n    end\n\n    after :all do\n      ...\n    end\n\n  end\n"
- !ruby/struct:SM::Flow::P 
  body: The <tt>before :each</tt> block will run before each of the examples, once for each example. Likewise, the <tt>after :each</tt> block will run after each of the examples.
- !ruby/struct:SM::Flow::P 
  body: It is also possible to specify a <tt>before :all</tt> and <tt>after :all</tt> block that will run only once for each behaviour, respectively before the first <tt>before :each</tt> and after the last <tt>after :each</tt>. The use of these is generally discouraged, because it introduces dependencies between the examples. Still, it might prove useful for very expensive operations if you know what you are doing.
- !ruby/struct:SM::Flow::H 
  level: 2
  text: Local helper methods
- !ruby/struct:SM::Flow::P 
  body: "You can include local helper methods by simply expressing them within a context:"
- !ruby/struct:SM::Flow::VERB 
  body: "  describe &quot;...&quot; do\n\n    it &quot;...&quot; do\n      helper_method\n    end\n\n    def helper_method\n      ...\n    end\n\n  end\n"
- !ruby/struct:SM::Flow::H 
  level: 2
  text: Included helper methods
- !ruby/struct:SM::Flow::P 
  body: "You can include helper methods in multiple contexts by expressing them within a module, and then including that module in your context:"
- !ruby/struct:SM::Flow::VERB 
  body: "  module AccountExampleHelperMethods\n    def helper_method\n      ...\n    end\n  end\n\n  describe &quot;A new account&quot; do\n    include AccountExampleHelperMethods\n    before do\n      @account = Account.new\n    end\n\n    it &quot;should have a balance of $0&quot; do\n      helper_method\n      @account.balance.should eql(Money.new(0, :dollars))\n    end\n  end\n"
- !ruby/struct:SM::Flow::H 
  level: 2
  text: Shared Example Groups
- !ruby/struct:SM::Flow::P 
  body: You can define a shared Example Group, that may be used on other groups
- !ruby/struct:SM::Flow::VERB 
  body: " share_examples_for &quot;All Editions&quot; do\n   it &quot;all editions behaviour&quot; ...\n end\n\n describe SmallEdition do\n   it_should_behave_like &quot;All Editions&quot;\n\n   it &quot;should do small edition stuff&quot; do\n     ...\n   end\n end\n"
- !ruby/struct:SM::Flow::P 
  body: You can also assign the shared group to a module and include that
- !ruby/struct:SM::Flow::VERB 
  body: " share_as :AllEditions do\n   it &quot;should do all editions stuff&quot; ...\n end\n\n describe SmallEdition do\n   it_should_behave_like AllEditions\n\n   it &quot;should do small edition stuff&quot; do\n     ...\n   end\n end\n"
- !ruby/struct:SM::Flow::P 
  body: And, for those of you who prefer to use something more like Ruby, you can just include the module directly
- !ruby/struct:SM::Flow::VERB 
  body: " describe SmallEdition do\n   include AllEditions\n\n   it &quot;should do small edition stuff&quot; do\n     ...\n   end\n end\n"
constants: 
- !ruby/object:RI::Constant 
  comment: 
  - !ruby/struct:SM::Flow::P 
    body: "TODO: BT - Deprecate BehaviourRunner?"
  name: BehaviourRunner
  value: ExampleGroupRunner
full_name: Spec::Runner
includes: []

instance_methods: []

name: Runner
superclass: 
