Permalink
Browse files

Version 0.4.0

  • Loading branch information...
1 parent 018e7b1 commit cd89a875ce3b3f46e102d1bd7da02978094fe4b9 @apeiros committed Mar 18, 2010
Showing with 2,970 additions and 2,180 deletions.
  1. +6 −0 MANIFEST.txt
  2. +53 −46 README.rdoc
  3. +1 −1 Rakefile
  4. +33 −0 baretest.gemspec
  5. +44 −7 bin/baretest
  6. +26 −8 dev/CurrentVersion/ToDo.txt
  7. +16 −0 dev/FutureVersion/RackStack.txt
  8. +10 −0 dev/RoadMap.txt
  9. +84 −0 dev/Snippets/DSL - tabular setup data.rb
  10. +6 −0 dev/Snippets/Inode - find by.rb
  11. +36 −0 dev/suites/skipreasons.rb
  12. +3 −2 doc/news/news-0.3.0.rdoc
  13. +9 −0 doc/news/news-0.4.0.rdoc
  14. +263 −152 docs/BareTest.html
  15. +65 −59 docs/BareTest/Assertion.html
  16. +1 −3 docs/BareTest/Assertion/Context.html
  17. +0 −2 docs/BareTest/Assertion/Failure.html
  18. +1 −3 docs/BareTest/Assertion/Skip.html
  19. +299 −310 docs/BareTest/Assertion/Support.html
  20. +0 −197 docs/BareTest/Assertion/Support/SetupAndTeardown.html
  21. +280 −204 docs/BareTest/CommandLine.html
  22. +9 −11 docs/BareTest/Formatter.html
  23. +0 −2 docs/BareTest/IRBMode.html
  24. +135 −83 docs/BareTest/IRBMode/IRBContext.html
  25. +1 −3 docs/BareTest/InvalidSelectors.html
  26. +210 −57 docs/BareTest/Persistence.html
  27. +163 −159 docs/BareTest/Run.html
  28. +0 −2 docs/BareTest/Run/CLI.html
  29. +0 −2 docs/BareTest/Run/Minimal.html
  30. +0 −2 docs/BareTest/Run/None.html
  31. +0 −2 docs/BareTest/Run/Profile.html
  32. +0 −2 docs/BareTest/Run/Spec.html
  33. +0 −2 docs/BareTest/Run/TAP.html
  34. +0 −2 docs/BareTest/Run/XML.html
  35. +10 −13 docs/BareTest/Status.html
  36. +278 −280 docs/BareTest/Suite.html
  37. +31 −35 docs/BareTest/UID.html
  38. +4 −6 docs/BareTest/VERSION.html
  39. +7 −9 docs/Command.html
  40. +17 −19 docs/Command/DecoratingHash.html
  41. +32 −34 docs/Command/Definition.html
  42. +0 −2 docs/Command/DirectoryNotFoundError.html
  43. +0 −2 docs/Command/FileNotFoundError.html
  44. +0 −2 docs/Command/NoDirectoryError.html
  45. +0 −2 docs/Command/NoFileError.html
  46. +18 −20 docs/Command/Parser.html
  47. +2 −4 docs/Command/VERSION.html
  48. +103 −25 docs/Kernel.html
  49. +1 −3 docs/LICENSE_txt.html
  50. +6 −5 docs/MANIFEST_txt.html
  51. +57 −70 docs/README_rdoc.html
  52. +2 −2 docs/bin/baretest.html
  53. +1 −1 docs/created.rid
  54. +1 −3 docs/doc/baretest_rdoc.html
  55. +1 −3 docs/doc/mocking_stubbing_test_doubles_rdoc.html
  56. +1 −3 docs/doc/quickref_rdoc.html
  57. +1 −3 docs/doc/whats_going_on_rdoc.html
  58. +1 −3 docs/doc/writing_tests_rdoc.html
  59. +158 −138 docs/index.html
  60. +3 −6 docs/lib/baretest/assertion/context_rb.html
  61. +2 −2 docs/lib/baretest/assertion/failure_rb.html
  62. +2 −2 docs/lib/baretest/assertion/skip_rb.html
  63. +2 −2 docs/lib/baretest/assertion/support_rb.html
  64. +2 −2 docs/lib/baretest/assertion_rb.html
  65. +2 −2 docs/lib/baretest/commandline_rb.html
  66. +2 −2 docs/lib/baretest/formatter_rb.html
  67. +2 −2 docs/lib/baretest/invalidselectors_rb.html
  68. +2 −2 docs/lib/baretest/irb_mode_rb.html
  69. +2 −2 docs/lib/baretest/layout_rb.html
  70. +2 −2 docs/lib/baretest/persistence_rb.html
  71. +2 −2 docs/lib/baretest/run/cli_rb.html
  72. +2 −2 docs/lib/baretest/run/minimal_rb.html
  73. +2 −2 docs/lib/baretest/run/none_rb.html
  74. +2 −2 docs/lib/baretest/run/profile_rb.html
  75. +2 −2 docs/lib/baretest/run/spec_rb.html
  76. +2 −2 docs/lib/baretest/run/tap_rb.html
  77. +2 −2 docs/lib/baretest/run/xml_rb.html
  78. +2 −2 docs/lib/baretest/run_rb.html
  79. +1 −1 docs/lib/baretest/safe_rb.html
  80. +2 −2 docs/lib/baretest/setup_rb.html
  81. +2 −2 docs/lib/baretest/status_rb.html
  82. +2 −2 docs/lib/baretest/suite_rb.html
  83. +2 −2 docs/lib/baretest/uid_rb.html
  84. +2 −2 docs/lib/baretest/use/mocha_rb.html
  85. +2 −2 docs/lib/baretest/use/rack_test_rb.html
  86. +3 −6 docs/lib/baretest/use/rr_rb.html
  87. +54 −0 docs/lib/baretest/use/support_rb.html
  88. +2 −2 docs/lib/baretest/version_rb.html
  89. +4 −2 docs/lib/baretest_rb.html
  90. +2 −2 docs/lib/command/argument_rb.html
  91. +2 −2 docs/lib/command/decoratinghash_rb.html
  92. +2 −2 docs/lib/command/definition_rb.html
  93. +2 −2 docs/lib/command/directorynotfounderror_rb.html
  94. +2 −2 docs/lib/command/env_rb.html
  95. +2 −2 docs/lib/command/filenotfounderror_rb.html
  96. +3 −3 docs/lib/command/kernel_rb.html
  97. +2 −2 docs/lib/command/nodirectoryerror_rb.html
  98. +2 −2 docs/lib/command/nofileerror_rb.html
  99. +2 −2 docs/lib/command/option_rb.html
  100. +2 −2 docs/lib/command/parser_rb.html
  101. +2 −2 docs/lib/command/result_rb.html
  102. +2 −4 docs/lib/command/types_rb.html
  103. +4 −2 docs/lib/command/version_rb.html
  104. +2 −2 docs/lib/command_rb.html
  105. +2 −2 docs/lib/ruby/kernel_rb.html
  106. +14 −0 examples/README_EXAMPLES.rdoc
  107. +22 −0 examples/components/mocha.rb
  108. +49 −0 examples/components/rr.rb
  109. +16 −0 examples/isolation/example1.rb
  110. +41 −6 lib/baretest.rb
  111. +15 −7 lib/baretest/assertion.rb
  112. +14 −3 lib/baretest/commandline.rb
  113. +36 −9 lib/baretest/irb_mode.rb
  114. +52 −1 lib/baretest/persistence.rb
  115. +10 −7 lib/baretest/run.rb
  116. +16 −8 lib/baretest/run/cli.rb
  117. +6 −6 lib/baretest/status.rb
  118. +18 −4 lib/baretest/suite.rb
  119. +1 −2 lib/baretest/uid.rb
  120. +4 −8 lib/baretest/use/mocha.rb
  121. +11 −7 lib/baretest/use/rr.rb
  122. +1 −1 lib/baretest/version.rb
  123. +7 −0 rake/tasks/gem.rake
  124. +1 −1 test/suite/lib/baretest/assertion.rb
View
@@ -5,11 +5,16 @@ bin/baretest
doc/baretest.rdoc
doc/mocking_stubbing_test_doubles.rdoc
doc/news/news-0.3.0.rdoc
+doc/news/news-0.4.0.rdoc
doc/quickref.rdoc
doc/whats_going_on.rdoc
doc/writing_tests.rdoc
+examples/README_EXAMPLES.rdoc
+examples/components/mocha.rb
examples/components/rack-test.rb
+examples/components/rr.rb
examples/irb_mode/failures.rb
+examples/isolation/example1.rb
examples/rake/test.rake
examples/tests/01_basics_I.rb
examples/tests/02_basics_II_helpers.rb
@@ -46,6 +51,7 @@ lib/baretest/uid.rb
lib/baretest/use/mocha.rb
lib/baretest/use/rack_test.rb
lib/baretest/use/rr.rb
+lib/baretest/use/support.rb
lib/baretest/version.rb
lib/command.rb
lib/command/argument.rb
View
@@ -87,58 +87,49 @@ right one: `rake gem:install GEM=gem1.9`
Usage:
- baretest [options] [glob, ...]
-
- Glob defaults to 'test/**/*.rb'
- Providing a directory as glob is equivalent to dir/**/*.rb
- Options:
- -f, --format FORMAT use FORMAT for output
- -F, --formats show available formats
- -d, --debug set debugging flags (set $DEBUG to true)
- -i, --interactive drop into IRB on error or failure
- -s, --setup FILE specify setup file
- -v, --version print the version and exit
- -w, --warn turn warnings on for your script
-
-
-
-== Planned Features
-
-* Passing on flags/options for formatters
-* Tagging tests to allow focusing (only run tests with/without specific tags)
-* Word-wrapping for CLI runner
-* Flags for color and verbose (\[no-]color and \[no-]verbose) for the executable
-* baretest --init \[LAYOUT], to create the necessary directory structure
-* Detect whether baretest is run from an interactive terminal or not and adjust
- defaults (no-color e.g.)
-* Alternative CLI runner with status implicit via colored/bg-colored descriptions
-* Alternative CLI runner which prints the name of the test prior the label and rewrites
- the line when the test has executed to add status & coloring.
-* Simple stubbing with automatic cleanup at teardown. Example:
-
- assert "Should require a single file listed in :requires option." do |a|
- file = 'foo/bar'
- stub(Kernel, :require) do |file, *args| a.touch(file) end
- ::Test::Suite.create(nil, nil, :requires => file)
+ baretest [command] [options] *(selector | -selector)
+ command: The command to run. See `baretest commands`
+ options: The flags and options, see in the "Options" section.
+ selector: The tests to run. Example:
+ baretest -- test/suite/a -test/suite/a/x @tag -@other %failure -%pending
+ Defaults to 'test/{suite,unit,integration,system}
+ See `baretest selectors` to get more information
- touched file
- end
-
-* Inline tests via Module#describe (basically the same as Test::Suite#suite)
-* YARD code to extract the specifications without running the code
-* A redmine plugin
-* --fail-all flag, to test/review diagnostics of tests (no idea how to do that yet)
-
-
-
-== Rejected Features
+ Default command is 'run', which runs the testsuite or the provided testfiles.
+
+ Options:
+
+ --commands overview over the commands
+ -d, --debug set debugging flags (set $DEBUG to true)
+ -i, --interactive drop into IRB on error or failure. Use 'help!' in the irb session for more information
+ -f, --format FORMAT use FORMAT for output, see `baretest formats`
+ -s, --setup FILE specify setup file
+ -w, --warn turn warnings on for your script
+ -h, --help help for usage and flags
+ -v, --version print the version and exit
+ --init Deprecated form for `baretest --init`
+
+ Options for 'CLI' formatter:
+
+ -c, --[no-]color Enable/disable output coloring
+ -p, --[no-]profile Enable/disable profiling assertions
+
+ Environment variables for 'CLI' formatter:
+
+ * COLOR Enable/disable output coloring
+ * PROFILE Enable/disable profiling assertions
+
+ Environment variables:
+
+ * FORMAT use FORMAT for output, see `baretest formats`
+ * VERBOSE turn warnings on for your script
+ * INTERACTIVE drop into IRB on error or failure. Use 'help!' in the irb session for more information
-* Currently none
== A Bit of Background
-Originally, bare-test started out as a project for shits & giggles on the flight
+Originally, baretest started out as a project for shits & giggles on the flight
back from vegas (railsconf09), to prove that it is possible to have a fully
fledged test-framework in under 100 lines of source-code.
Later I realized that this project could become more. For one it was (still is)
@@ -256,13 +247,29 @@ From examples/test.rb:
* Tass
* adding rr integration
* reporting bugs
+* robgleeson
+ * Introducing me to rack-test
+ * Feedback
+
+
== Known bugs
Currently none.
+== Known issues
+
+* A setup that raises an exception will cause all teardowns to not be executed.
+ This will change in a future release as follows: a setup that raises an
+ exception will only cause teardowns defined on the same suite not to be
+ executed.
+* --interactive can't be used to investigate problems in setup or teardown
+* Inherited skip reasons are not reported
+
+
+
== Foot Notes
<sup>1</sup>:: The abbreviated form without support code and output formatters.
The normal code is expanded to more lines for readability.
View
@@ -22,7 +22,7 @@ Project.meta.use_git = true
Project.manifest.ignore = %w[
Rakefile
- beat/**/*
+ baretest.gemspec
dev/**/*
doc/announcements/**/*
docs/**/*
View
@@ -0,0 +1,33 @@
+# DON'T MODIFY THIS FILE! THIS FILE IS AUTOMATICALLY GENERATED.
+# -*- encoding: utf-8 -*-
+
+Gem::Specification.new do |s|
+ s.name = %q{baretest}
+ s.version = "0.4.0.pre3"
+
+ s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
+ s.authors = ["Stefan Rusterholz"]
+ s.date = %q{2010-03-14}
+ s.default_executable = %q{baretest}
+ s.description = %q{Baretest is a Testframework that tries to stay out of your way, but support
+you when you want it. In order to do so it has a load of features:}
+ s.email = %q{stefan.rusterholz@gmail.com}
+ s.executables = ["baretest"]
+ s.files = ["LICENSE.txt", "MANIFEST.txt", "README.rdoc", "bin/baretest", "doc/baretest.rdoc", "doc/mocking_stubbing_test_doubles.rdoc", "doc/news/news-0.3.0.rdoc", "doc/quickref.rdoc", "doc/whats_going_on.rdoc", "doc/writing_tests.rdoc", "examples/README_EXAMPLES.rdoc", "examples/components/mocha.rb", "examples/components/rack-test.rb", "examples/components/rr.rb", "examples/irb_mode/failures.rb", "examples/rake/test.rake", "examples/tests/01_basics_I.rb", "examples/tests/02_basics_II_helpers.rb", "examples/tests/03_basics_III_setup_and_teardown.rb", "examples/tests/04_advanced_I_dependencies.rb", "examples/tests/05_advanced_II_tags.rb", "examples/tests/06_advanced_III_requires.rb", "examples/tests/07_advanced_IV_components.rb", "examples/tests/08_expert_I_setup_variants.rb", "lib/baretest.rb", "lib/baretest/assertion.rb", "lib/baretest/assertion/context.rb", "lib/baretest/assertion/failure.rb", "lib/baretest/assertion/skip.rb", "lib/baretest/assertion/support.rb", "lib/baretest/commandline.rb", "lib/baretest/formatter.rb", "lib/baretest/invalidselectors.rb", "lib/baretest/irb_mode.rb", "lib/baretest/layout.rb", "lib/baretest/persistence.rb", "lib/baretest/run.rb", "lib/baretest/run/cli.rb", "lib/baretest/run/minimal.rb", "lib/baretest/run/none.rb", "lib/baretest/run/profile.rb", "lib/baretest/run/spec.rb", "lib/baretest/run/tap.rb", "lib/baretest/run/xml.rb", "lib/baretest/setup.rb", "lib/baretest/status.rb", "lib/baretest/suite.rb", "lib/baretest/uid.rb", "lib/baretest/use/mocha.rb", "lib/baretest/use/rack_test.rb", "lib/baretest/use/rr.rb", "lib/baretest/use/support.rb", "lib/baretest/version.rb", "lib/command.rb", "lib/command/argument.rb", "lib/command/decoratinghash.rb", "lib/command/definition.rb", "lib/command/directorynotfounderror.rb", "lib/command/env.rb", "lib/command/filenotfounderror.rb", "lib/command/kernel.rb", "lib/command/nodirectoryerror.rb", "lib/command/nofileerror.rb", "lib/command/option.rb", "lib/command/parser.rb", "lib/command/result.rb", "lib/command/types.rb", "lib/command/version.rb", "lib/ruby/kernel.rb", "test/setup.rb", "test/suite/lib/baretest.rb", "test/suite/lib/baretest/assertion.rb", "test/suite/lib/baretest/assertion/context.rb", "test/suite/lib/baretest/assertion/failure.rb", "test/suite/lib/baretest/assertion/skip.rb", "test/suite/lib/baretest/assertion/support.rb", "test/suite/lib/baretest/irb_mode.rb", "test/suite/lib/baretest/run.rb", "test/suite/lib/baretest/run/cli.rb", "test/suite/lib/baretest/run/errors.rb", "test/suite/lib/baretest/run/interactive.rb", "test/suite/lib/baretest/run/spec.rb", "test/suite/lib/baretest/run/tap.rb", "test/suite/lib/baretest/run/xml.rb", "test/suite/lib/baretest/suite.rb"]
+ s.homepage = %q{http://baretest.rubyforge.org}
+ s.rdoc_options = ["--inline-source", "--line-numbers", "--charset", "utf-8", "--tab-width", "2", "-t", "baretest-0.4.0.pre3"]
+ s.require_paths = ["lib"]
+ s.rubyforge_project = %q{baretest}
+ s.rubygems_version = %q{1.3.6}
+ s.summary = %q{A testframework that doesn’t stand in your way or forces you to learn a new language. Two methods is all that is required to know. If you need it, it provides you with all kinds of features to support you writing your tests.}
+
+ if s.respond_to? :specification_version then
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
+ s.specification_version = 3
+
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
+ else
+ end
+ else
+ end
+end
View
@@ -51,7 +51,7 @@ Command "run" do
o :commands
o :debug, '-d', '--debug', :Boolean, "set debugging flags (set $DEBUG to true)"
- o :interactive, '-i', '--interactive', :Boolean, "drop into IRB on error or failure"
+ o :interactive, '-i', '--interactive', :Boolean, "drop into IRB on error or failure. Use 'help!' in the irb session for more information"
o :format, '-f', '--format FORMAT', :String, "use FORMAT for output, see `baretest formats`"
o :setup_file, '-s', '--setup FILE', :File, "specify setup file"
o :verbose, '-w', '--warn', :Boolean, "turn warnings on for your script"
@@ -80,12 +80,47 @@ Command "run" do
o :help
end
- command "formats"
- command "env"
- command "version"
- command "commands"
- command "selectors"
- command "help"
+ command "reset" do
+ usage
+
+ virtual_argument :command
+ end
+
+ command "formats" do
+ usage
+
+ virtual_argument :command
+ end
+
+ command "env" do
+ usage
+
+ virtual_argument :command
+ end
+
+ command "version" do
+ usage
+
+ virtual_argument :command
+ end
+
+ command "commands" do
+ usage
+
+ virtual_argument :command
+ end
+
+ command "selectors" do
+ usage
+
+ virtual_argument :command
+ end
+
+ command "help" do
+ usage
+
+ virtual_argument :command
+ end
end
@@ -135,6 +170,8 @@ Command.with(ARGV) do
exit(success ? 0 : 1)
when "init" # create the test directory
BareTest::CommandLine.init(arguments, options)
+ when "reset" # trash runtime stats & caching
+ BareTest::CommandLine.reset(arguments, options)
when "formats" # list available formats
BareTest::CommandLine.formats(arguments, options)
when "env" # show information about baretest (config, version, paths, ...)
@@ -1,9 +1,3 @@
-BUGS:
-* Correct skip reason must be implemented.
-* load helpers when specifying custom globs
- - look for (?:\A|/)test/ and replace with test/helpers
-
-
CHORES:
* Verify that persistence works as expected no matter from where baretest is run
and with what glob.
@@ -16,8 +10,6 @@ CHORES:
FEATURES:
-* BareTest.external_file, returning an absolute path for a path relative to
- TEST/external dir
MISSING TESTS:
@@ -38,3 +30,29 @@ support.rb:
assert "Should not make the suite skipped if more than everything it depends_on is provided"
assert "Should make the suite skipped if not everything it depends_on is provided"
end
+
+must be moved to "run" tests:
+ assert "Runs all enclosing suite's setup blocks, outermost first" do
+ executed = []
+ block1 = proc { executed << :block1 }
+ block2 = proc { executed << :block2 }
+ suite1 = ::BareTest::Suite.new("block1") do setup(&block1) end
+ suite2 = ::BareTest::Suite.new("suite2", suite1) do setup(&block2) end
+ assertion = ::BareTest::Assertion.new(suite2, "assertion")
+
+ raises_nothing do assertion.setup end &&
+ equal([:block1, :block2], executed)
+ end
+
+ assert "Runs all enclosing suite's teardown blocks, innermost first" do
+ executed = []
+ block1 = proc { executed << :block1 }
+ block2 = proc { executed << :block2 }
+ suite1 = ::BareTest::Suite.new("block1") do teardown(&block1) end
+ suite2 = ::BareTest::Suite.new("suite2", suite1) do teardown(&block2) end
+ assertion = ::BareTest::Assertion.new(suite2, "assertion")
+
+ raises_nothing do assertion.teardown end &&
+ equal([:block2, :block1], executed)
+ end
+
@@ -0,0 +1,16 @@
+User interaction:
+- visit (enter address in url bar and go there)
+- click_link
+- click_button
+- select_checkbox (<input type="checkbox" ...>)
+- select_radio_button (<input type="radio" ...>)
+- select_option (<select><option>...)
+- type_text (<textarea>, <input type="text", <input type="password")
+- click_item (css/xpath selector)
+- drag_item
+
+Verifications:
+- no_broken_internal_links
+- no_broken_external_links
+- no_broken_links (internal+external)
+- 200-ok
View
@@ -1,6 +1,10 @@
0.5:
+ * understanding of project- and file-mode (former uses layout, with setup.rb,
+ helpers et al, later runs a single isolated file)
+ Also with regards to saved state
* forked suite execution - auto-isolation
* forked suite execution - parallel execution
+ * setup_once (via forking after setup)
0.6:
* website integration teststack for rack based frameworks
@@ -15,6 +19,8 @@
* rails integration (controllers, models, views, helpers)
* full ruby-debug integration
* full rcov integration
+ * better rr integration (not having to do .call at the end of spying, not
+ having to return true in the end of spying assertions, ...)
0.7:
* continuous testing on OS X (fsevents+growl)
@@ -27,6 +33,8 @@
0.9:
* Correct self-test suite with proper isolation of bootstrapping
* Implement test-layouts
+ * Implement `baretest update`, which will add suites for currently untested
+ files, namespaces and methods (by convention)
1.0:
* Polish, polish, polish
@@ -46,6 +54,8 @@ UNASSIGNED
* auto-require corresponding lib-files
* guard assertions - sometimes we make assumptions in our tests, guard
assertions let us test those assumptions
+* Cleanly separate exercise and verify phase (currently exercise is a bit split
+ between setup and assert, and verify is in assert).
REJECTED
* configuration system
Oops, something went wrong.

0 comments on commit cd89a87

Please sign in to comment.