0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
RSpec plugin for Crispy you can use with rspec-mocks. Privides matchers such as have_received to use Crispy's API in RSpec's way.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.7
~> 10.0

Runtime

>= 0.3.3
~> 3.0
 Project Readme

RSpec::Crispy

Build Status Test Coverage Code Climate

Custom matchers for RSpec to call Crispy's API.

Installation

Add this line to your application's Gemfile:

gem 'rspec-crispy'

And then execute:

$ bundle

Or install it yourself as:

$ gem install rspec-crispy

Usage

Use with rspec-mocks

Add ::RSpec::Crispy.configure_without_conflict config in your spec_helper.rb.

RSpec.configure do|config|
  config.mock_with(:rspec)
  ::RSpec::Crispy.configure_without_conflict config
end

Then, include ::RSpec::Crispy::CrispyFeatures in a context where you want to use the features.

RSpec.describe YourClass do

  subject { YourClass }

  context 'use crispy' do
    include ::RSpec::Crispy::CrispyFeatures

    before do
      spy_into subject
      subject.new.hoge
    end

    it { is_expected.to have_received(:foo) }
  end

  context 'use rspec-mocks' do
    subject { spy("rspec's spy") }

    before { some_object.some_method(spy) }

    it { is_expected.to have_received(:foo) }
  end

end

Use only rspec-crispy (without rspec-mocks)

TODO: Write usage instructions here

Available Crispy API

TODO: Write usage instructions here

Contributing

  1. Fork it ( https://github.com/igrep/rspec-crispy/fork )
  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 a new Pull Request

NOTE

  • You must use rake test to run rspec spec/rspec/crispy/configure_without_conflict_spec.rb and rspec spec/rspec/crispy/mock_with_rspec_crispy_spec.rb separately. DO NOT run all specs at once by rspec spec.