module RSpecApi::Expectations::Response::Body::Sort

Public Instance Methods

expect_a_sorted(response, expectations = {}) click to toggle source
# File lib/rspec-api/expectations/body/sort.rb, line 8
def expect_a_sorted(response, expectations = {})
  include RSpecApi::Matchers

  if should_check_sorted(response, expectations)
    it { expect(response).to be_sorted expectations[:sort] }
  end
end

Private Instance Methods

should_check_sorted(response, expectations) click to toggle source
# File lib/rspec-api/expectations/body/sort.rb, line 18
def should_check_sorted(response, expectations)
  expectations.key?(:sort)
end