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_activity_service-0.0.5 spec/support/mutations_matchers.rb
restpack_activity_service-0.0.4 spec/support/mutations_matchers.rb
restpack_activity_service-0.0.3 spec/support/mutations_matchers.rb