Sha256: e0500761c7a840f6f97d5971ebf809d3ccaba41fc46027a8e0fb4d94959fde93

Contents?: true

Size: 1.36 KB

Versions: 13

Compression:

Stored size: 1.36 KB

Contents

require File.dirname(__FILE__) + '/../../test_helper'
module Spec
  module Runner
    class SpecMatcherTest < Test::Unit::TestCase
      
      def test_should_match_context_and_spec
        matcher = SpecMatcher.new("a context with a spec", "a context")
        assert matcher.matches?("with a spec")
      end
      
      def test_should_not_match_wrong_context
        matcher = SpecMatcher.new("another context with a spec", "a context")
        assert !matcher.matches?("with a spec")
      end
     
      def test_should_not_match_wrong_spec
        matcher = SpecMatcher.new("a context with another spec", "a context")
        assert !matcher.matches?("with a spec")
      end
      
      def test_should_match_context_only
        matcher = SpecMatcher.new("a context", "a context")
        assert matcher.matches?("with a spec")
      end
      
      def test_should_not_match_wrong_context_only
        matcher = SpecMatcher.new("another context", "a context")
        assert !matcher.matches?("with a spec")
      end
      
      def test_should_match_spec_only
        matcher = SpecMatcher.new("with a spec", "a context")
        assert matcher.matches?("with a spec")
      end
      
      def test_should_match_wrong_spec_only
        matcher = SpecMatcher.new("with another spec", "a context")
        assert !matcher.matches?("with a spec")
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
rspec-0.5.12 test/spec/runner/spec_matcher_test.rb
rspec-0.5.11 test/spec/runner/spec_matcher_test.rb
rspec-0.5.10 test/spec/runner/spec_matcher_test.rb
rspec-0.5.13 test/spec/runner/spec_matcher_test.rb
rspec-0.5.16 test/spec/runner/spec_matcher_test.rb
rspec-0.5.5 test/spec/runner/spec_matcher_test.rb
rspec-0.5.7 test/spec/runner/spec_matcher_test.rb
rspec-0.5.8 test/spec/runner/spec_matcher_test.rb
rspec-0.5.9 test/spec/runner/spec_matcher_test.rb
rspec-0.5.15 test/spec/runner/spec_matcher_test.rb
rspec-0.5.14 test/spec/runner/spec_matcher_test.rb
rspec-0.5.6 test/spec/runner/spec_matcher_test.rb
rspec-0.6.0 test/spec/runner/spec_matcher_test.rb