Sha256: 8f4cd618c38fb84bfe23d7631d6fcbe1a5d6e4d8133859d43b9f8fdaa22d0f5c

Contents?: true

Size: 1.17 KB

Versions: 8

Compression:

Stored size: 1.17 KB

Contents

require File.dirname(__FILE__)  + '/../lib/spec'
require 'test/unit'

class RspecIntegrationTest < Test::Unit::TestCase
  def self.fixtures(*args)
    @@fixtures = true
  end
  
  def self.verify_class_method
    @@fixtures.should_be true
  end
  
  def setup
    @test_case_setup_called = true
  end

  def teardown
    @test_case_teardown_called = true
  end

  def run(result)
  end

  def helper_method
    @helper_method_called = true
  end
end

module RandomHelperModule
  def random_task
    @random_task_called = true
  end
end

context "Rspec should integrate with Test::Unit::TestCase" do
  inherit RspecIntegrationTest
  include RandomHelperModule

  fixtures :some_table

  setup do
    @rspec_setup_called = true
  end

  specify "TestCase#setup should be called." do
    @test_case_setup_called.should_be true
    @rspec_setup_called.should_be true
  end

  specify "Rspec should be able to access TestCase methods" do
    helper_method
    @helper_method_called.should_be true
  end

  specify "Rspec should be able to accept included modules" do
    random_task
    @random_task_called.should_be true
  end
  
  teardown do
    RspecIntegrationTest.verify_class_method
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rspec-0.5.16 examples/test_case_spec.rb
rspec-0.5.15 examples/test_case_spec.rb
rspec-0.5.14 examples/test_case_spec.rb
rspec-0.6.1 examples/test_case_spec.rb
rspec-0.6.2 examples/test_case_spec.rb
rspec-0.6.4 examples/test_case_spec.rb
rspec-0.6.3 examples/test_case_spec.rb
rspec-0.6.0 examples/test_case_spec.rb