views:

171

answers:

3

Hi,

Is Rspec ruby/rails specific? Is it possible to use it as a test framework for C/C++ program?

A: 

Description of Rspec says:

RSpec is the original Behaviour Driven Development framework for Ruby.

I think that means this tool is Ruby specific. For c++ you could use Boost Test Library or other tools.

Kirill V. Lyadvinsky
rasjani
+1  A: 

I don't think that RSpec works for C++, but you should check out this comprehension: http://gamesfromwithin.com/exploring-the-c-unit-testing-framework-jungle

From my experience: You can use CppUnit, but it's somehow painful. There's a lot of overhead per test (overhead means lines of code), so adding tests becomes annoying. CppTest looks a bit better, and cxxtest seems really nice, though I haven't used the last two myself.

Larry_Croft
+1 for the link.
pierr
+5  A: 

Here's a good article on using RSpec and swig: http://blog.objectmentor.com/articles/2008/02/04/unit-testing-c-and-c-with-ruby-and-rspec

Noah Thorp