File: test_declarative_test.rb

package info (click to toggle)
ruby-test-declarative 0.0.5-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 76 kB
  • sloc: ruby: 46; makefile: 2
file content (17 lines) | stat: -rw-r--r-- 512 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
$: << File.expand_path('../../lib', __FILE__)

require 'test/unit'
require 'test_declarative'

class TestDeclarativeTest < Test::Unit::TestCase
  def test_responds_to_test
    assert self.class.respond_to?(:test)
  end
  
  def test_adds_a_test_method
    called = false
    assert_nothing_raised { Test::Unit::TestCase.test('some test') { called = true } }
    Test::Unit::TestCase.new(:'test_some_test').run((RUBY_VERSION < '1.9.1' ? Test::Unit::TestResult : MiniTest::Unit).new) {}
    assert called
  end
end