Sha256: d4a23559d58463c5742d84c4354745e6ccf6f09eeaa8d6683251cce3d3e318fc

Contents?: true

Size: 735 Bytes

Versions: 20

Compression:

Stored size: 735 Bytes

Contents

dir = File.dirname(__FILE__)
require "#{dir}/test_helper"

class TestUnitIntegrationTest < Test::Unit::TestCase
  def setup
    super
    @subject = Object.new
  end

  def teardown
    super
  end

  def test_using_a_mock
    mock(@subject).foobar(1, 2) {:baz}
    assert_equal :baz, @subject.foobar(1, 2)
  end
  
  def test_using_a_stub
    stub(@subject).foobar {:baz}
    assert_equal :baz, @subject.foobar("any", "thing")
  end

  def test_using_a_probe
    def @subject.foobar
      :baz
    end

    probe(@subject).foobar
    assert_equal :baz, @subject.foobar
  end

  def test_times_called_verification
    mock(@subject).foobar(1, 2) {:baz}
    assert_raise RR::Errors::TimesCalledError do
      teardown
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
rr-0.1.13 examples/rr/test_unit/test_unit_integration_test.rb
rr-0.1.15 examples/rr/test_unit/test_unit_integration_test.rb
rr-0.1.2 examples/rr/test_unit/test_unit_integration_test.rb
rr-0.1.5 examples/rr/test_unit/test_unit_integration_test.rb
rr-0.1.12 examples/rr/test_unit/test_unit_integration_test.rb
rr-0.1.6 examples/rr/test_unit/test_unit_integration_test.rb
rr-0.1.8 examples/rr/test_unit/test_unit_integration_test.rb
rr-0.1.14 examples/rr/test_unit/test_unit_integration_test.rb
rr-0.1.1 examples/rr/test_unit/test_unit_integration_test.rb
rr-0.1.10 examples/rr/test_unit/test_unit_integration_test.rb
rr-0.1.11 examples/rr/test_unit/test_unit_integration_test.rb
rr-0.1.3 examples/rr/test_unit/test_unit_integration_test.rb
rr-0.1.4 examples/rr/test_unit/test_unit_integration_test.rb
rr-0.1.7 examples/rr/test_unit/test_unit_integration_test.rb
rr-0.2.1 examples/rr/test_unit/test_unit_integration_test.rb
rr-0.2.3 examples/rr/test_unit/test_unit_integration_test.rb
rr-0.2.5 examples/rr/test_unit/test_unit_integration_test.rb
rr-0.2.2 examples/rr/test_unit/test_unit_integration_test.rb
rr-0.2.4 examples/rr/test_unit/test_unit_integration_test.rb
rr-0.1.9 examples/rr/test_unit/test_unit_integration_test.rb