0.03
No release in over a year
Twirp RSpec matchers
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

 Project Readme

RSpec::Twirp

Gem codecov

Twirp RSpec matchers.

require "rspec/twirp"

it "matches Twirp responses" do
  is_expected.to be_a_twirp_response
  is_expected.to be_a_twirp_response(count: 3)
  is_expected.to be_a_twirp_response.with_error(:not_found)
end

it "matches Twirp messages" do
  is_expected.to be_a_twirp_message
  is_expected.to be_a_twirp_message(MyRequest)
  is_expected.to be_a_twirp_message(name: /^B/)
end

it "matches Twirp errors" do
  is_expected.to be_a_twirp_error
  is_expected.to be_a_twirp_error(:internal)
end

To stub Twirp requests, see webmock-twirp.


Contributing

Yes please :)

  1. Fork it
  2. Create your feature branch (git checkout -b my-feature)
  3. Ensure the tests pass (bundle exec rspec)
  4. Commit your changes (git commit -am 'awesome new feature')
  5. Push your branch (git push origin my-feature)
  6. Create a Pull Request