Doctest::RSpec
Add doctest to your rspec
Installation
Add this line to your application's Gemfile:
gem 'doctest-rspec'
And then execute:
$ bundle
Or install it yourself as:
$ gem install doctest-rspec
Usage
Add doctest-formatted tests to your ruby files (see http://github.com/hzeus/doctest-extractor for syntax examples)
Configure RSpec:
RSpec.configure do |c|
c.extend Doctest::RSpec::DoctestHelpers
end
Add doctest:
describe 'whatever' do
doctest MyClassWithDoctests
end
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request