Testing Unsupported Group Type Exception Handling in ruby-grape/grape
This test suite validates the handling of unsupported group types in the Grape framework, focusing on exception behavior and deprecated class handling. The tests ensure proper error messaging and backward compatibility for group type validation.
Test Coverage Overview
Implementation Analysis
Technical Details
Best Practices Demonstrated
ruby-grape/grape
spec/grape/exceptions/unsupported_group_type_spec.rb
# frozen_string_literal: true
require 'shared/deprecated_class_examples'
RSpec.describe Grape::Exceptions::UnsupportedGroupType do
subject { described_class.new }
describe '#message' do
subject { described_class.new.message }
it { is_expected.to include 'group type must be Array, Hash, JSON or Array[JSON]' }
end
describe 'Grape::Exceptions::UnsupportedGroupTypeError' do
let(:deprecated_class) { Grape::Exceptions::UnsupportedGroupTypeError }
it_behaves_like 'deprecated class'
end
end