All Projects → peterc → Testrocket

peterc / Testrocket

Licence: other
Super simple Ruby testing library

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Testrocket

Rstest
Fixture-based test framework for Rust
Stars: ✭ 182 (-20.52%)
Mutual labels:  testing-tools
Specjour
distributed rspec & cucumber via bonjour
Stars: ✭ 214 (-6.55%)
Mutual labels:  testing-tools
Gauge
Light weight cross-platform test automation
Stars: ✭ 2,622 (+1044.98%)
Mutual labels:  testing-tools
Hitchhiker
a Restful Api test tool
Stars: ✭ 2,175 (+849.78%)
Mutual labels:  testing-tools
Power assert ex
Power Assert in Elixir. Shows evaluation results each expression.
Stars: ✭ 201 (-12.23%)
Mutual labels:  testing-tools
Sbtuitesttunnel
Enable network mocks and more in UI Tests
Stars: ✭ 215 (-6.11%)
Mutual labels:  testing-tools
Environmentoverrides
QA assistant for a SwiftUI app: change the color scheme, accessibility settings, and localization on the fly!
Stars: ✭ 181 (-20.96%)
Mutual labels:  testing-tools
Goreplay
As your application grows, the effort required to test it also grows exponentially. GoReplay offers you the simple idea of reusing your existing traffic for testing, which makes it incredibly powerful. Our state of art technique allows you to analyze and record your application traffic without affecting it. This eliminates the risks that come with putting a third party component in the critical path.
Stars: ✭ 14,981 (+6441.92%)
Mutual labels:  testing-tools
Testdeck
Object oriented testing
Stars: ✭ 206 (-10.04%)
Mutual labels:  testing-tools
Ali
Generate HTTP load and plot the results in real-time
Stars: ✭ 3,055 (+1234.06%)
Mutual labels:  testing-tools
Allure Docker Service
This docker container allows you to see up to date reports simply mounting your "allure-results" directory in the container (for a Single Project) or your "projects" directory (for Multiple Projects). Every time appears new results (generated for your tests), Allure Docker Service will detect those changes and it will generate a new report automatically (optional: send results / generate report through API), what you will see refreshing your browser.
Stars: ✭ 194 (-15.28%)
Mutual labels:  testing-tools
Bats Core
Bash Automated Testing System
Stars: ✭ 2,820 (+1131.44%)
Mutual labels:  testing-tools
Localroast
Mock a server for development and testing
Stars: ✭ 217 (-5.24%)
Mutual labels:  testing-tools
Tork
💞 Tests your Ruby code, in parallel, as you change it
Stars: ✭ 185 (-19.21%)
Mutual labels:  testing-tools
Recheck Web
recheck for web apps – change comparison tool with local Golden Masters, Git-like ignore syntax and "Unbreakable Selenium" tests.
Stars: ✭ 224 (-2.18%)
Mutual labels:  testing-tools
Botium Core
The Selenium for Chatbots - Bots Testing Bots
Stars: ✭ 181 (-20.96%)
Mutual labels:  testing-tools
Simple Headless Chrome
Simple abstraction to use Chrome as a Headless Browser with Node JS
Stars: ✭ 216 (-5.68%)
Mutual labels:  testing-tools
Htmltestrunner
A Test Runner in python, for Human Readable HTML Reports
Stars: ✭ 228 (-0.44%)
Mutual labels:  testing-tools
Junit Dataprovider
A TestNG like dataprovider runner for JUnit with many additional features
Stars: ✭ 226 (-1.31%)
Mutual labels:  testing-tools
Fsharp Hedgehog
Release with confidence, state-of-the-art property testing for .NET.
Stars: ✭ 219 (-4.37%)
Mutual labels:  testing-tools
 _            _                  _         _
| |_  ___ ___| |_ _ __ ___   ___| | __ ___| |_
| __|/ _ | __| __| '__/ _ \ / __| |/ // _ \ __|
| |_|  __|__ \ |_| | | (_) | (__|   <|  __/ |_
 \__|\___|___/\__|_|  \___/ \___|_|\_\\___|\__|

Testrocket is a super simple (as simple as it gets really) testing library for Ruby 2.0 and higher.

It was initially developed for a CodeBrawl contest and it won! People asked me to release it 'for real' so here we are.

To install:

gem install testrocket

.. or add it to your Gemfile in the usual way.

As yet there are no useful bits and pieces for creating test files (look at the example, it's easy!) or Rake tasks. But it's all crazy simple. A few things may be added later on.

Note: Prior to version 1, TestRocket extended built-in classes to work, but has (in 2019) been modernized to use refinements to avoid it clashing with third party libraries in real world scenarios (yes, people use this library in real world code!)

Dependencies

  • Ruby 2.1 or higher
  • minitest/spec (part of MRI 1.9+ standard library)

Example

require 'testrocket'
using TestRocket

# BASIC USAGE
# +-> { block that should succeed }
# --> { block that should fail }

+-> { Die.new(2) }
--> { raise }
+-> { 2 + 2 == 4 }

# These two tests will deliberately fail
+-> { raise }
--> { true }

# A 'pending' test
~-> { "this is a pending test" }

# A description
!-> { "use this for descriptive output and to separate your test parts" }

As well as running tests in separate test files in the 'traditional' way, TestRocket can also be used 'inline' with real world code. A trivial example:

class YourClass
  using TestRocket

  def initialize
  end

  def does_something
    # ...
  end

  +->{  # a test for does_something goes here }

  def does_something_else
    # ...
  end

  +->{  # a test for does_something_else goes here }
  -->{  # a test for does_something_else goes here }
end

In this way, your class is tested each time you run the app in development or test modes. Note that if TestRocket detects RACK_ENV is production, RAILS_ENV is production or Rails is running and Rails.env.production? is true, the usual TestRocket methods will simply pass straight through so as to not impede performance on the loading of your app.

Other Features

By default, output is written to STDERR (as well as returned by the test expressions themselves). You can override where test output goes like so:

TestRocket.out = File.new('/dev/null', 'w')

TestRocket.out also supports Logger instances.

Credits

Initial concept and maintenance by Peter Cooper

Extra concepts and code by Christoph Grabo

Thanks to Gary Bernhardt for often praising and shining attention on TestRocket :-)

Thanks to Serge Bedzhyk for modernizing the library to use refinements.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].