Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jgaskins/tspec
Threaded RSpec-style testing proof of concept
https://github.com/jgaskins/tspec
Last synced: 22 days ago
JSON representation
Threaded RSpec-style testing proof of concept
- Host: GitHub
- URL: https://github.com/jgaskins/tspec
- Owner: jgaskins
- License: mit
- Created: 2013-09-10T06:31:54.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-09-10T06:32:16.000Z (over 11 years ago)
- Last Synced: 2024-12-09T10:55:45.954Z (25 days ago)
- Language: Ruby
- Homepage:
- Size: 109 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# TSpec
Lightweight spec framework inspired by RSpec (because, really, what isn't inspired by RSpec these days?). Syntax intends to be compatible with RSpec's `expect` syntax. For example:
```ruby
describe Foo do
let(:foo) { Foo.new }it 'does a thing' do
expect(foo.bar).to eq 'baz'
end
end
```Matchers currently available:
- `eq` (equality using `==` operator): `expect(foo.bar).to eq 'baz'`
- `raise_error` (given block is expected to raise the specified exception): `expect { foo.bar }.to raise_error Baz`
- `be_a` (given object is expected to be an instance of the given class or one of its subclasses): `expect(foo).to be_a Foo`
- `be` (equality compared using `Object.equal?`): `expect(foo).to be foo`TSpec is intended to be able to run your specs in parallel.
## Installation
Add this line to your application's Gemfile:
gem 'tspec'
And then execute:
$ bundle
Or install it yourself as:
$ gem install tspec
## Usage
To run an individual spec file:
$ tspec spec/path/to/spec.rb
You can run all spec files within a directory:
$ tspec spec/unit # will load spec/unit/**/*_spec.rb
Run with no arguments to run all specs in the `./spec` directory:
$ tspec
## Contributing
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request