Sha256: d6e54cf1a3fc756f71a0640a23847e7ccb21df806be8e7cb4eb4fd5622824839

Contents?: true

Size: 1.3 KB

Versions: 17

Compression:

Stored size: 1.3 KB

Contents

require 'test/spec'

require 'test/spec/dox'

context "SpecDox" do
  setup do
    r = Test::Unit::UI::SpecDox::TestRunner.new(nil)
    @unmangler = r.method(:unmangle)
  end
  
  specify "can unmangle Test::Unit names correctly" do
    @unmangler["test_foo_bar(TestFoo)"].should.equal ["Foo", "foo bar"]
    @unmangler["test_foo_bar(FooTest)"].should.equal ["Foo", "foo bar"]
    @unmangler["test_he_he(Foo)"].should.equal ["Foo", "he he"]
    @unmangler["test_heh(Foo)"].should.equal ["Foo", "heh"]

    @unmangler["test_heh(Test::Unit::TC_Assertions)"].
      should.equal ["Test::Unit::TC_Assertions", "heh"]

    @unmangler["test_heh(Foo::Bar::Test)"].
      should.equal ["Foo::Bar::Test", "heh"]
  end

  specify "can unmangle Test::Spec names correctly" do
    @unmangler["test_spec {context} 007 [whee]()"].
      should.equal ["context", "whee"]
    @unmangler["test_spec {a bit longish context} 069 [and more text]()"].
      should.equal ["a bit longish context", "and more text"]
    @unmangler["test_spec {special chars !\"/&%$} 2 [special chars !\"/&%$]()"].
      should.equal ["special chars !\"/&%$", "special chars !\"/&%$"]
    @unmangler["test_spec {[]} 666666 [{}]()"].
      should.equal ["[]", "{}"]
  end

  specify "has sensible fallbacks" do
    @unmangler["weird"].should.equal [nil, nil]
  end
end
  

Version data entries

17 entries across 17 versions & 5 rubygems

Version Path
jordi-xml_struct-0.1.3 test/vendor/test-spec/test/spec_dox.rb
jordi-xml_struct-0.2.0 test/vendor/test-spec/test/spec_dox.rb
jordi-xml_struct-0.2.1 test/vendor/test-spec/test/spec_dox.rb
nullstyle-test-spec-0.4.1 test/spec_dox.rb
relevance-test-spec-0.4.0.5 test/spec_dox.rb
relevance-test-spec-0.4.1.1 test/spec_dox.rb
relevance-test-spec-0.4.1.2 test/spec_dox.rb
relevance-test-spec-0.4.1 test/spec_dox.rb
mofo-0.1.1 vendor/testspec-0.2.0/test/spec_dox.rb
mofo-0.1.2 vendor/testspec-0.3.0/test/spec_dox.rb
mofo-0.2.2 vendor/testspec-0.3.0/test/spec_dox.rb
mofo-0.2.1 vendor/testspec-0.3.0/test/spec_dox.rb
mofo-0.2 vendor/testspec-0.3.0/test/spec_dox.rb
test-spec-0.9.0 test/spec_dox.rb
test-spec-0.4.0 test/spec_dox.rb
test-spec-0.3.0 test/spec_dox.rb
test-spec-0.10.0 test/spec_dox.rb