Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lsegal/yard-spec-plugin
YARD Plugin example that documents RSpec code (live example in homepage)
https://github.com/lsegal/yard-spec-plugin
Last synced: 2 months ago
JSON representation
YARD Plugin example that documents RSpec code (live example in homepage)
- Host: GitHub
- URL: https://github.com/lsegal/yard-spec-plugin
- Owner: lsegal
- License: mit
- Created: 2009-05-30T01:09:33.000Z (over 15 years ago)
- Default Branch: master
- Last Pushed: 2019-08-08T16:04:39.000Z (over 5 years ago)
- Last Synced: 2024-10-14T21:24:50.335Z (3 months ago)
- Language: Ruby
- Homepage: http://lsegal.github.com/yard-spec-plugin
- Size: 146 KB
- Stars: 50
- Watchers: 4
- Forks: 17
- Open Issues: 5
-
Metadata Files:
- Readme: README.rdoc
- License: LICENSE
Awesome Lists containing this project
README
= Embedding RSpec Specifications in YARD Documentation
This plugin demonstrates how RSpec tests can be embedded within standard documentation
using only a small amount of plugin code. The example generates documentation
for the following {String#pig_latin} method and RSpec tests:# Run `yardoc -e ../lib/yard-rspec example_code.rb`
class String
# Pig latin of a String
def pig_latin
self[1..-1] + self[0] + "ay"
end
end#
# Specs
#
describe String, '#pig_latin' do
it "should be a pig!" do
"hello".pig_latin.should == "ellohay"
endit "should fail to be a pig!" do
"hello".pig_latin.should == "hello"
end
endView the "Specifications" section within the {String#pig_latin} method to see
these tests.