Sha256: df622671e2128e7ce123eb9a9b687c44f14a4dc366937f7cf7a6e2ff68fafaca

Contents?: true

Size: 780 Bytes

Versions: 23

Compression:

Stored size: 780 Bytes

Contents

def is_required(*params)
  params.each do |param|
    it ":#{param} parameter must be required" do
      expect(subject.class.input_filters.required_inputs).to include(param)
    end
  end
end

def is_optional(*params)
  params.each do |param|
    it ":#{param} parameter must be required" do
      expect(subject.class.input_filters.optional_inputs).to include(param)
    end
  end
end

def service_request_with(param, value, &block)
  context "when :#{param} = #{value.inspect}" do
    let(:params) do
      super().merge({ param => value })
    end
    it { yield(response.result) }
  end
end

def service_should_map(param, map)
  context param do
    map.each do |value, expected|
      service_request_with(param, value) { |r| r[param].should == expected }
    end
  end
end

Version data entries

23 entries across 23 versions & 2 rubygems

Version Path
restpack_service-0.0.46 lib/restpack_service/support/matchers.rb
restpack_service-0.0.45 lib/restpack_service/support/matchers.rb
restpack_service-0.0.44 lib/restpack_service/support/matchers.rb
restpack_service-0.0.43 lib/restpack_service/support/matchers.rb
restpack_service-0.0.42 lib/restpack_service/support/matchers.rb
restpack_service-0.0.41 lib/restpack_service/support/matchers.rb
restpack_service-0.0.40 lib/restpack_service/support/matchers.rb
restpack_service-0.0.39 lib/restpack_service/support/matchers.rb
restpack_service-0.0.38 lib/restpack_service/support/matchers.rb
restpack_service-0.0.37 lib/restpack_service/support/matchers.rb
restpack_service-0.0.36 lib/restpack_service/support/matchers.rb
restpack_service-0.0.35 lib/restpack_service/support/matchers.rb
restpack_service-0.0.34 lib/restpack_service/support/matchers.rb
restpack_service-0.0.33 lib/restpack_service/support/matchers.rb
restpack_service-0.0.32 lib/restpack_service/support/matchers.rb
restpack_service-0.0.31 lib/restpack_service/test_support/matchers.rb
restpack_service-0.0.30 lib/restpack_service/test_support/matchers.rb
restpack_service-0.0.29 lib/restpack_service/test_support/matchers.rb
restpack_activity_service-0.0.8 spec/support/mutations_matchers.rb
restpack_activity_service-0.0.7 spec/support/mutations_matchers.rb