RSpec::Twirp
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 :)
- Fork it
- Create your feature branch (
git checkout -b my-feature
) - Ensure the tests pass (
bundle exec rspec
) - Commit your changes (
git commit -am 'awesome new feature'
) - Push your branch (
git push origin my-feature
) - Create a Pull Request