Sha256: f98bafb9e2aef856de575aadb760d753a02f62d3d84bde14bfef42338e63b346

Contents?: true

Size: 924 Bytes

Versions: 4

Compression:

Stored size: 924 Bytes

Contents

require File.dirname(__FILE__) + '/../../../test_helper'

module Spec
  module Api
    module Helper
      class ShouldMatchTest < Test::Unit::TestCase

        def test_should_not_raise_when_objects_match
          assert_nothing_raised do
            "hi aslak".should.match /aslak/
          end
        end

        def test_should_raise_when_objects_do_not_match
          assert_raise(ExpectationNotMetError) do
            "hi aslak".should.match /steve/
          end
        end
      end

      class ShouldNotMatchTest < Test::Unit::TestCase
        def test_should_not_raise_when_objects_do_not_match
          assert_nothing_raised do
            "hi aslak".should.not.match /steve/
          end
        end

        def test_should_raise_when_objects_match
          assert_raise(ExpectationNotMetError) do
            "hi aslak".should.not.match /aslak/
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rspec-0.5.15 test/spec/api/helper/regex_matching_test.rb
rspec-0.5.13 test/spec/api/helper/regex_matching_test.rb
rspec-0.5.14 test/spec/api/helper/regex_matching_test.rb
rspec-0.5.16 test/spec/api/helper/regex_matching_test.rb