Skip to content

Commit

Permalink
refactor: remove custom Response object
Browse files Browse the repository at this point in the history
  • Loading branch information
ksol committed Feb 11, 2024
1 parent f584b8a commit dbbf99a
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 400 deletions.
7 changes: 0 additions & 7 deletions lib/scalingo/api/endpoint.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require "forwardable"
require "scalingo/api/response"

module Scalingo
module API
Expand All @@ -23,12 +22,6 @@ def inspect
str << ">"
str
end

private

def unpack(*keys, &block)
Response.unpack(client, keys: keys, &block)
end
end
end
end
69 changes: 0 additions & 69 deletions lib/scalingo/api/response.rb

This file was deleted.

23 changes: 0 additions & 23 deletions spec/scalingo/api/endpoint_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,4 @@
expect(subject.connection).to eq :value
end
end

describe "unpack" do
it "forwards unpack to Response without keys" do
mock = proc { 1 }

expect(Scalingo::API::Response).to receive(:unpack).with(client, keys: [], &mock).and_return(:d).once
expect(subject.send(:unpack, &mock)).to eq :d
end

it "forwards unpack to Response with a single key" do
mock = proc { 1 }

expect(Scalingo::API::Response).to receive(:unpack).with(client, keys: [:a], &mock).and_return(:d).once
expect(subject.send(:unpack, :a, &mock)).to eq :d
end

it "forwards unpack to Response with many keys" do
mock = proc { 1 }

expect(Scalingo::API::Response).to receive(:unpack).with(client, keys: [:a, :b], &mock).and_return(:d).once
expect(subject.send(:unpack, :a, :b, &mock)).to eq :d
end
end
end
Loading

0 comments on commit dbbf99a

Please sign in to comment.