Sha256: 639aca4ae8a03d8b2f76fe0748f2176b4441e094e731f35b45f4708c0480c699

Contents?: true

Size: 773 Bytes

Versions: 4

Compression:

Stored size: 773 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

4 entries across 4 versions & 2 rubygems

Version Path
has_finder-0.1.1 spec/rails/vendor/plugins/rspec/spec/spec/runner/context_matching_spec.rb
has_finder-0.1.2 spec/rails/vendor/plugins/rspec/spec/spec/runner/context_matching_spec.rb
has_finder-0.1.3 spec/rails/vendor/plugins/rspec/spec/spec/runner/context_matching_spec.rb
rspec-1.0.5 spec/spec/runner/context_matching_spec.rb