spec2-mocks alternatives and similar shards
Based on the "Testing" category.
Alternatively, view spec2-mocks alternatives based on common mentions on social networks and blogs.
-
spec2.cr
Enhanced `spec` testing library for [Crystal](http://crystal-lang.org/). -
LuckyFlow
Automated browser tests for web applications. Similar to Ruby's Capybara. -
power_assert.cr
PowerAssert provides the more powerful assertion to you. -
microtest
Smaller test framework, because it has power asserts as the only assertion. -
timecop.cr
Mock with `Time.now` with the power of time travel, time freeze and time scale. -
mock
Doubles (stubs and mocks) library for Crystal, inspired by the API of rspec-mocks -
webdriver_pump
Page Object Model library for Crystal. A port (kind of) of Ruby's WatirPump
Access the most powerful time series database as a service
Do you think we are missing an alternative of spec2-mocks or a related project?
README
spec2-mocks
This is an adapter of mocks.cr for spec2.cr.
Installation
Make sure, that you have correct versions of spec2
and mocks
in you
shard.yml
in depdendencies
section.
Next, add this to your application's shard.yml
:
dependencies:
spec2-mocks:
github: waterlink/spec2-mocks.cr
version: ~> 0.4
Usage
require "spec2-mocks"
This additionally adds before { Mocks.reset }
to each top-level
Spec2.describe
.
Using have_received
matcher
expect(person).to have_received(say("hello world"))
Using receive
matcher
expect(person).to receive(say("hello world"))
This uses spec2
's delayed { ... }
feature to verify expectations after the
end of the example.
Development
After cloning the project:
cd spec2-mocks.cr
crystal deps # install dependencies
crystal spec # run specs
Just use normal TDD development style.
Contributing
- Fork it ( https://github.com/waterlink/spec2-mocks.cr/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
Contributors
- waterlink Oleksii Fedorov - creator, maintainer