RSpec
Developer(s) | David Chelimsky, Myron Marston, Andy Lindeman, Jon Rowe, Paul Casaretto, Sam Phippen, Bradley Schaefer[1] |
---|---|
Initial release | May 18, 2007[2] |
Stable release | |
Operating system | Cross-platform |
Type | Behavior driven development framework / Test tool |
License | MIT License |
Website |
rspec |
RSpec is a behavior-driven development (BDD) framework for the Ruby programming language, inspired by JBehave.[4] It contains its own mocking framework that is fully integrated into the framework based upon JMock. The framework can be considered a domain-specific language (DSL) and resembles a natural language specification.
Usage Examples
#Testing for our User class
describe User do
context 'with admin privileges' do
before :each do
@admin = Admin.get(1)
end
it 'should exist' do
expect(@admin).not_to be_nil
end
it 'should have a name' do
expect(@admin.name).not_to be_false
end
end
#...
end
See also
References
- ↑ RSpec core team. Retrieved 8 April 2013.
- ↑ "all versions of rspec". rubygems.org. Retrieved 11 February 2014.
- ↑ https://rubygems.org/gems/rspec/versions/3.5.0
- ↑ Ed Gibbs, JBehave and RSpec History (Blog entry)
Further reading
- Chelimsky, David; Astels, Dave; Helmkamp, Bryan; North, Dan; Dennis, Zach; Hellesoy, Aslak (December 22, 2010). "The RSpec Book: Behaviour Driven Development with Rspec, Cucumber, and Friends" (First ed.). Pragmatic Bookshelf: 448. ISBN 978-1934356371.
External links
- Official website
- RSpec-2
- Beyond Test Driven Development - Behaviour Driven Development. A Google TechTalk by Dave Astels on BDD using RSpec.
- RSpec Best Practices Article by Jared Carroll, retrieved April 24 2011.
- Behavior-driven testing with RSpec Article by Bruce Tate, retrieved July 21 2011.
This article is issued from Wikipedia - version of the 12/1/2016. The text is available under the Creative Commons Attribution/Share Alike but additional terms may apply for the media files.