Sha256: 3d0295718470ce4a8180fc279fb3b7bf6ea251972d0de365b0eb8510a50e389d

Contents?: true

Size: 1.13 KB

Versions: 1

Compression:

Stored size: 1.13 KB

Contents

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

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

        def setup
          @dummy = 'dummy'
          @equal_dummy = 'dummy'
          @another_dummy  = 'another_dummy'
          @nil_var = nil
        end

        # should.equal
  
        def test_should_equal_should_not_raise_when_objects_are_equal
          assert_nothing_raised do
            @dummy.should.equal @equal_dummy
          end
        end
  
        def test_should_equal_should_raise_when_objects_are_not_equal
          assert_raise(ExpectationNotMetError) do
            @dummy.should.equal @another_dummy
          end
        end

        # should.not.equal

        def test_should_not_equal_should_not_raise_when_objects_are_not_equal
          assert_nothing_raised do
            @dummy.should.not.equal @another_dummy
          end
        end

        def test_should_not_equal_should_raise_when_objects_are_not_equal
          assert_raise(ExpectationNotMetError) do
            @dummy.should.not.equal @equal_dummy
          end
        end

      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rspec-0.5.0 test/spec/api/helper/equality_test.rb