All Projects → toroidal-code → cppspec

toroidal-code / cppspec

Licence: MIT License
BDD testing for C++ à la RSpec

Programming Languages

C++
36643 projects - #6 most used programming language
CMake
9771 projects

Projects that are alternatives of or similar to cppspec

Spectrum
A BDD-style test runner for Java 8. Inspired by Jasmine, RSpec, and Cucumber.
Stars: ✭ 142 (+992.31%)
Mutual labels:  rspec, bdd
Everydayrails Rspec 2017
Sample source for the 2017 edition of Everyday Rails Testing with RSpec.
Stars: ✭ 280 (+2053.85%)
Mutual labels:  rspec, bdd
ginkgo4j
A Java BDD Testing Framework (based on RSpec and Ginkgo)
Stars: ✭ 25 (+92.31%)
Mutual labels:  rspec, bdd
Aruba
Test command-line applications with Cucumber-Ruby, RSpec or Minitest. The most up to date documentation can be found on Cucumber.Pro (https://app.cucumber.pro/projects/aruba)
Stars: ✭ 900 (+6823.08%)
Mutual labels:  rspec, bdd
Nspec
A battle hardened testing framework for C# that's heavily inspired by Mocha and RSpec.
Stars: ✭ 242 (+1761.54%)
Mutual labels:  rspec, bdd
bdd
Given/When/Then/And/But output to RSpec and Minitest
Stars: ✭ 33 (+153.85%)
Mutual labels:  rspec, bdd
pytest-it
Decorate your pytest suite with RSpec-style pytest markers, then run `pytest --it` to see a plaintext spec of the test structure.
Stars: ✭ 26 (+100%)
Mutual labels:  rspec, bdd
gavel-spec
Behavior specification for Gavel, validator of HTTP transactions
Stars: ✭ 105 (+707.69%)
Mutual labels:  bdd
Android-Cucumber-BDD-Sample
A sample project that has most of the tests and code written in a Behaviour Driven Development style, using the Cucumber framework.
Stars: ✭ 29 (+123.08%)
Mutual labels:  bdd
karate-runner
VSCode Extension for Karate
Stars: ✭ 23 (+76.92%)
Mutual labels:  bdd
kheera-testrunner-android
BDD Framework for Android
Stars: ✭ 18 (+38.46%)
Mutual labels:  bdd
pactum
REST API Testing Tool for all levels in a Test Pyramid
Stars: ✭ 190 (+1361.54%)
Mutual labels:  bdd
LocalSupport
A directory of local support services and volunteer opportunities
Stars: ✭ 60 (+361.54%)
Mutual labels:  rspec
CtCI-with-Ruby-TDD
Cracking the Coding Interview with Ruby and TDD
Stars: ✭ 44 (+238.46%)
Mutual labels:  rspec
yo-ruby
🌈 ✨ A super awesome Ruby wrapper of the Yo API.
Stars: ✭ 15 (+15.38%)
Mutual labels:  rspec
apple-mango
Python BDD Pattern
Stars: ✭ 18 (+38.46%)
Mutual labels:  bdd
automate-home
Yet another python home automation (iot) project. Because a smart light is more than just on or off.
Stars: ✭ 59 (+353.85%)
Mutual labels:  bdd
orion
A next-generation testing tool. Orion provides a powerful DSL to write and automate your acceptance tests
Stars: ✭ 40 (+207.69%)
Mutual labels:  bdd
site-infrastructure-tests
Test framework that allows analysts/marketers to specify site infrastructure regression tests for dev
Stars: ✭ 23 (+76.92%)
Mutual labels:  bdd
rspec n
A ruby gem that runs RSpec N times.
Stars: ✭ 37 (+184.62%)
Mutual labels:  rspec

C++Spec version

Travis  AppVeyor  GitHub release  Github Releases  Documentation Status

A behavior-driven development testing library for C++ with an RSpec-inspired DSL.

Warning! This is pre-release software and may be incomplete, contain bugs, and/or introduce major breaking changes within a short period of time

Installation

C++Spec will be released as a single collated header-file that can be placed in any include path in your project. After that, all features are available via #include "cppspec.hpp".

If you want to use the git repo for development or to integrate it into your own project as a submodule, releases will also be available as tags. This project's include folder should then be added to your project's include path. Again, all functionality is exposed through #include "cppspec.hpp".

If you want to manually generate the collated cppspec.hpp yourself, you can download the ccollate tool here and then run ./ccollate.rb include/cppspec.hpp > cppspec.hpp in the toplevel directory of the C++Spec repo. A fully-featured cppspec.hpp file will then be available in the root of the project for usage.

Documentation

See http://cppspec.readthedocs.org/ for full documentation and a tutorial.

Requirements

C++Spec requires a compiler with support for C++11 and polymorphic lambda expressions from C++14. This includes GCC >= 4.9, MSVCC >= 14.0, or clang >= 3.4. For other compilers check this chart.

Note: Only the tests require being compiled with C++14 support (-std=c++14). No other part of an existing project's build must be modified.

Introduction

If you've ever used RSpec or Jasmine, chances are you'll be familiar with C++Spec's syntax. For example, this is a C++Spec version of the first snippet on RSpec's README.

#include "cppspec.hpp"
#include "order.hpp"

describe order_spec("Order", $ {
  it("sums the prices of its line items", _ {
    Order order();

	order.add_entry(LineItem().set_item(Item()
	  .set_price(Money(1.11, Money::USD))
	));

	order.add_entry(LineItem().set_item(Item()
	  .set_price(Money(1.11, Money::USD))
	  .set_quantity(2)
	));

	expect(order.total()).to_equal(Money(5.55, Money::USD));
  });
});


int main(){
  return CppSpec::Runner(CppSpec::Formatters::verbose)
             .add_spec(order_spec)
             .exec() ? EXIT_SUCCESS : EXIT_FAILURE;
}

FAQ

Attribution

Heavily inspired by RSpec and Jasmine.

Authors

Copyright © 2014-2016 Katherine Whitlock

License

The project is licensed under the MIT License.

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].