Sha256: b9cffe21ced4225e0b14789098e8d2ed32271b42b4873bb885f31ab7a39c4946

Contents?: true

Size: 972 Bytes

Versions: 13

Compression:

Stored size: 972 Bytes

Contents

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

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

      # should.match

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

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

        # should.not.match

        def test_should_not_match_should_not_raise_when_objects_do_not_match
          assert_nothing_raised do
            "hi aslak".should.not.match /steve/
          end
        end

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

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
rspec-0.5.1 test/spec/api/helper/regex_matching_test.rb
rspec-0.5.10 test/spec/api/helper/regex_matching_test.rb
rspec-0.5.11 test/spec/api/helper/regex_matching_test.rb
rspec-0.5.12 test/spec/api/helper/regex_matching_test.rb
rspec-0.5.0 test/spec/api/helper/regex_matching_test.rb
rspec-0.5.5 test/spec/api/helper/regex_matching_test.rb
rspec-0.5.6 test/spec/api/helper/regex_matching_test.rb
rspec-0.5.8 test/spec/api/helper/regex_matching_test.rb
rspec-0.5.9 test/spec/api/helper/regex_matching_test.rb
rspec-0.5.7 test/spec/api/helper/regex_matching_test.rb
rspec-0.5.2 test/spec/api/helper/regex_matching_test.rb
rspec-0.5.3 test/spec/api/helper/regex_matching_test.rb
rspec-0.5.4 test/spec/api/helper/regex_matching_test.rb