https://github.com/rubyworks/spectroscope
RSpec style BDD on RubyTest
https://github.com/rubyworks/spectroscope
Last synced: 11 months ago
JSON representation
RSpec style BDD on RubyTest
- Host: GitHub
- URL: https://github.com/rubyworks/spectroscope
- Owner: rubyworks
- License: other
- Created: 2012-02-23T18:01:45.000Z (almost 14 years ago)
- Default Branch: master
- Last Pushed: 2012-02-27T20:16:23.000Z (almost 14 years ago)
- Last Synced: 2025-03-09T08:15:42.838Z (11 months ago)
- Language: Ruby
- Homepage: http://rubyworks.github.com/spectra
- Size: 477 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: HISTORY.md
- License: COPYING.rdoc
Awesome Lists containing this project
README
# Spectroscope
FreeBSD Copyright (c) 2012 Rubyworks
[Homepage](http://rubyworks.github.com/spectroscope) /
[Report Issue](http://github.com/rubyworks/spectroscope/issues) /
[Source Code](http://github.com/rubyworks/spectroscope)
[](http://travis-ci.org/rubyworks/spectroscope)
## Description
Spectroscope is an RSpec-style BDD framework that runs on top of the [Ruby Test](http://rubyworks.github.com/rubytest),
the Ruby universal test harness. It supports all of RSpec's syntax, with a
few exceptions.
## Installation
$ gem install spectroscope
## Instruction
### Writing Specifications
Specifications are written as block of `describe` and `it` definitions.
Here's RSpec classic example:
describe Order do
it "sums the prices of its line items" do
order = Order.new
order.add_entry(LineItem.new(:item => Item.new(
:price => Money.new(1.11, :USD)
)))
order.add_entry(LineItem.new(:item => Item.new(
:price => Money.new(2.22, :USD),
:quantity => 2
)))
order.total.should eq(Money.new(5.55, :USD))
end
end
Spectroscope only handle the specification structure, it does not provide an
assertions system. For that use any of a number of available libraries,
such [Assay-RSpec](http://rubyworks.github.com/assay-rspec) or [AE](http://rubyworks.github.com/ae).
You can require these in a helper script, or in Ruby Test configuration (see below).
### Running Specifications
Running specification is done with the `rubytest` command line utility.
$ rubytest -Ilib -rae/should spec/*_spec.rb
To make things simpler, create a `.test` configuration file.
require 'ae/should'
Test.run :default do |run|
run.files << 'spec/*_spec.rb'
end
Then simply use:
$ rubytest
## Copyrights
Copyright (c) 2012 Rubyworks
Spectroscope is distributable according to the terms of the **FreeBSD** license.
See COPYING.rdoc for details.