Sha256: 71f1a6f2c05eea10056d3b51efa1c1dbebc6687d965cd6e22a0fbb97c107d23d

Contents?: true

Size: 772 Bytes

Versions: 10

Compression:

Stored size: 772 Bytes

Contents

require File.dirname(__FILE__) + '/../../spec_helper.rb'

module Spec
  module DSL
    describe "ContextMatching" do

      before(:each) do
        @formatter = Spec::Mocks::Mock.new("formatter")
        @behaviour = Behaviour.new("context") {}
      end

      it "run all specs when spec is not specified" do
        @behaviour.it("spec1") {}
        @behaviour.it("spec2") {}
        @behaviour.retain_examples_matching!(["context"])
        @behaviour.number_of_examples.should == 2
      end

      it "should only run specified examples when specified" do
        @behaviour.it("spec1") {}
        @behaviour.it("spec2") {}
        @behaviour.retain_examples_matching!(["context spec1"])
        @behaviour.number_of_examples.should == 1
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
rspec-0.9.3 spec/spec/runner/context_matching_spec.rb
rspec-0.9.0 spec/spec/runner/context_matching_spec.rb
rspec-0.9.1 spec/spec/runner/context_matching_spec.rb
rspec-0.9.2 spec/spec/runner/context_matching_spec.rb
rspec-0.9.4 spec/spec/runner/context_matching_spec.rb
rspec-1.0.0 spec/spec/runner/context_matching_spec.rb
rspec-1.0.1 spec/spec/runner/context_matching_spec.rb
rspec-1.0.2 spec/spec/runner/context_matching_spec.rb
rspec-1.0.3 spec/spec/runner/context_matching_spec.rb
rspec-1.0.4 spec/spec/runner/context_matching_spec.rb