Sha256: 470310e867ec62711093a6f1078b69b86dc1a1351eefe6f7edf34c5ceb332245

Contents?: true

Size: 748 Bytes

Versions: 24

Compression:

Stored size: 748 Bytes

Contents

$:.unshift File.join(File.dirname(__FILE__), *%w[.. .. .. lib])
require 'spec'

Spec::Runner.configure do |config|
  config.before(:suite) do
    $before_suite = "before suite"
  end
  config.before(:each) do
    @before_each = "before each"
  end
  config.before(:all) do
    @before_all = "before all"
  end
end

describe "stuff in before blocks" do
  describe "with :suite" do
    it "should be available in the example" do
      $before_suite.should == "before suite"
    end
  end
  describe "with :all" do
    it "should be available in the example" do
      @before_all.should == "before all"
    end
  end
  describe "with :each" do
    it "should be available in the example" do
      @before_each.should == "before each"
    end
  end
end

Version data entries

24 entries across 24 versions & 7 rubygems

Version Path
dchelimsky-rspec-1.1.10 stories/resources/spec/before_blocks_example.rb
dchelimsky-rspec-1.1.11.1 stories/resources/spec/before_blocks_example.rb
dchelimsky-rspec-1.1.11 stories/resources/spec/before_blocks_example.rb
jnstq-acts_as_sms-0.1.0 test/vendor/plugins/rspec/stories/resources/spec/before_blocks_example.rb
jnstq-acts_as_sms-0.1.1 test/vendor/plugins/rspec/stories/resources/spec/before_blocks_example.rb
jnstq-acts_as_sms-0.1.3 test/vendor/plugins/rspec/stories/resources/spec/before_blocks_example.rb
jnstq-acts_as_sms-0.1.4 test/vendor/plugins/rspec/stories/resources/spec/before_blocks_example.rb
merb-core-1.1.3 spec10/public/webrat/test_app/gems/gems/rspec-1.1.11/stories/resources/spec/before_blocks_example.rb
merb-core-1.1.2 spec10/public/webrat/test_app/gems/gems/rspec-1.1.11/stories/resources/spec/before_blocks_example.rb
merb-core-1.1.1 spec10/public/webrat/test_app/gems/gems/rspec-1.1.11/stories/resources/spec/before_blocks_example.rb
merb-core-1.1.0 spec10/public/webrat/test_app/gems/gems/rspec-1.1.11/stories/resources/spec/before_blocks_example.rb
merb-core-1.1.0.rc1 spec10/public/webrat/test_app/gems/gems/rspec-1.1.11/stories/resources/spec/before_blocks_example.rb
merb-core-1.1.0.pre spec10/public/webrat/test_app/gems/gems/rspec-1.1.11/stories/resources/spec/before_blocks_example.rb
mack-0.8.2 lib/gems/rspec-1.1.11/stories/resources/spec/before_blocks_example.rb
pictrails-0.5.0 vendor/plugins/rspec/stories/resources/spec/before_blocks_example.rb
rspec-1.1.10 stories/resources/spec/before_blocks_example.rb
rspec-1.1.11 stories/resources/spec/before_blocks_example.rb
rspec-1.1.6 stories/resources/spec/before_blocks_example.rb
rspec-1.1.5 stories/resources/spec/before_blocks_example.rb
rspec-1.1.7 stories/resources/spec/before_blocks_example.rb