Sha256: ee7552ae5df6a280cecadadcb2ba72a73e8a175c85582a21a959f403fd280095

Contents?: true

Size: 769 Bytes

Versions: 3

Compression:

Stored size: 769 Bytes

Contents

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

module Spec
  module DSL
    describe Behaviour do

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

      it "should retain examples that don't match" do
        @behaviour.it("example1") {}
        @behaviour.it("example2") {}
        @behaviour.retain_examples_matching!(["behaviour"])
        @behaviour.number_of_examples.should == 2
      end

      it "should remove examples that match" do
        @behaviour.it("example1") {}
        @behaviour.it("example2") {}
        @behaviour.retain_examples_matching!(["behaviour example1"])
        @behaviour.number_of_examples.should == 1
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rspec-1.0.6 spec/spec/runner/context_matching_spec.rb
rspec-1.0.7 spec/spec/runner/context_matching_spec.rb
rspec-1.0.8 spec/spec/runner/context_matching_spec.rb