https://github.com/metaskills/mini_shoulda
A minimal shoulda DSL built on top of MiniTest::Spec.
https://github.com/metaskills/mini_shoulda
Last synced: 5 months ago
JSON representation
A minimal shoulda DSL built on top of MiniTest::Spec.
- Host: GitHub
- URL: https://github.com/metaskills/mini_shoulda
- Owner: metaskills
- License: mit
- Created: 2011-01-24T16:34:43.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2013-01-19T23:09:55.000Z (over 12 years ago)
- Last Synced: 2024-12-08T21:52:24.261Z (10 months ago)
- Language: Ruby
- Homepage:
- Size: 122 KB
- Stars: 30
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.rdoc
- Changelog: CHANGELOG
- License: MIT-LICENSE
Awesome Lists containing this project
README
= Deprecated
== Please use the minitest-spec-rails gem and enable mini_shoulda
* https://github.com/metaskills/minitest-spec-rails
* https://github.com/metaskills/minitest-spec-rails#mini_shoulda= MiniShoulda
A minimal shoulda DSL built on top of MiniTest::Spec. MiniTest is the future, and we should all be
using it! No pun. The MiniShoulda gem is a simple set of alias built on top of MiniTest so that we can use
basic shoulda syntax. A simple example says it all.class MyTestClass < MiniTest::Spec
setup do
@object = Object.new
endteardown do
@object.freeze
endshould 'find object' do
assert @object
refute_instance_of Object, @object
endshould_eventually 'works too' do
refute true, 'will use skip and not run'
endcontext 'with another context' do
setup do
@object = [1,2,3]
endshould 'just work' do
assert_includes @object, 2
endend
end
= Install
$ gem install mini_shoulda
= What About ActiveRecord Macros
It is not my goal to implement all the ActiveRecord macros nor things like should_have_db_columns :)
= Any Hacks?
Not really. MiniShoulda is built on top of the existing MiniTest::Spec methods. Basically they are
just a series of aliases to those methods. Our only monkey patch is in MiniTest's Kernel#describe method
so you can maintain class scope in your own test cases. Please help me lobby the MiniTest team to get
that patch in.* https://github.com/seattlerb/minitest/pull/9