Git Product home page Git Product logo

test_unit_autorunner_order_of_tests's Introduction

test/unit gem - An order of tests executed with Test::AutoRunner has no consistency.

Environment

  • OS : Windows 10
  • ruby : ruby 2.5.3p105 (2018-10-18 revision 65156) [x64-mingw32]
  • test-unit (3.2.9)

How to run sample tests

Open a command prompt and set the current directory to the folder path of this file.

> bundle
> rake

Suggestion


--collector=load モードで、

TargetTest < CustomTest < Test::Unit::TestCase

という継承関係で作るのはおそらく慣例としてよくないのではないか?

(TestRunnerで、CustomTestもcollectorで集めてきて、テスト対象として扱ってしまうため、verboseで表示がおかしくなる)

共通処理などをはさみたい場合は、moduleにして、includeさせる方式がおそらく好ましい

→カテゴリ化したいケースは、フォルダ分けすることで、うまく表示してくれる


--collector=descendant モードでは、

継承関係にあるテストケースを対象にしてくれるモードのようなんだが、

どうやら、AutoRunner#runの前か、ブロックに指定して、 Test::Unit::TestCase::DESCENDANTS を事前に準備しておく必要があるようだ 使い方が分かりにくい

下記条件では、自動で対象を探してくれるほうがいいんではないかとは思うが

  • --collector=descendant オプション指定されている かつ
  • AutoRunnner#runの第二引数で対象のdir が指定されている かつ
  • Test::Unit::TestCase::DESCENDANTS がempty(明示されていない)

test_unit_autorunner_order_of_tests's People

Contributors

masa-kunikata avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.