matchi alternatives and similar shards
Based on the "Testing" category.
Alternatively, view matchi 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. -
timecop.cr
Mock with `Time.now` with the power of time travel, time freeze and time scale. -
microtest
Small test framework, because it has power asserts as the only assertion. -
mock
Doubles (stubs and mocks) library for Crystal, inspired by the API of rspec-mocks -
spec2-mocks
This library connects spec2.cr and mocks.cr, effectively enabling 'have_received' expectation for spec2. -
webdriver_pump
Page Object Model library for Crystal. A port (kind of) of Ruby's WatirPump -
hashr
Hashr is a tiny library makes test on JSON response easier, and can also be used as a models object.
Collect and Analyze Billions of Data Points in Real Time
Do you think we are missing an alternative of matchi or a related project?
Popular Comparisons
README
Matchi
Collection of expectation matchers for Crystal.
Contact
- Home page: https://github.com/fixcr/matchi
- Bugs/issues: https://github.com/fixcr/matchi/issues
Installation
Add this to your application's shard.yml
:
dependencies:
matchi:
github: fixcr/matchi
Usage
require "matchi"
Built-in matchers
Untruth matcher:
be_false = Matchi::BeFalse.new
be_false.matches? { false } # => true
Nil matcher:
be_nil = Matchi::BeNil.new
be_nil.matches? { nil } # => true
Truth matcher:
be_true = Matchi::BeTrue.new
be_true.matches? { true } # => true
Regular expressions matcher:
match = Matchi::Match.new(/^[a-z0-9_-]{3,16}$/)
match.matches? { "bob" } # => true
Expecting errors matcher:
raise_exception = Matchi::RaiseException.new(DivisionByZero)
raise_exception.matches? { 0 / 0 } # => true
Equivalence matcher:
same = Matchi::Same.new("foo")
same.matches? { "foo" } # => true
Custom matchers
Custom matchers can easily be defined for expressing expectations.
Be the answer matcher:
module Matchi
class BeTheAnswer
def matches?
42 === yield
end
end
end
be_the_answer = Matchi::BeTheAnswer.new
be_the_answer.matches? { 42 } # => true
Start with matcher:
module Matchi
class StartWith
def initialize(expected)
@expected = expected
end
def matches?
!Regex.new("^#{@expected}").match(yield).nil?
end
end
end
start_with = Matchi::StartWith.new("foo")
start_with.matches? { "foobar" } # => true
Versioning
Matchi follows Semantic Versioning 2.0.
Contributing
- Fork it
- 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
License
See LICENSE.md
file.
*Note that all licence references and agreements mentioned in the matchi README section above
are relevant to that project's source code only.