Skip to content

Commit

Permalink
Remove unused methods
Browse files Browse the repository at this point in the history
  • Loading branch information
MUTOgen committed Aug 10, 2024
1 parent 09bc072 commit 0ce2cb6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/cypress_on_rails/vcr/base_middleware.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module Vcr
class BaseMiddleware
include MiddlewareConfig

def initialize(_app, _vcr = nil)
def initialize(**_args)
raise_not_implemented
end

Expand Down
10 changes: 2 additions & 8 deletions lib/cypress_on_rails/vcr/use_cassette_middleware.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ def initialize(app, vcr = nil)
end

def call(env)
WebMock.enable! if defined?(WebMock)
vcr.turn_on!
request = Rack::Request.new(env)
cassette_name = fetch_request_cassette(request)
vcr.use_cassette(cassette_name, { record: configuration.vcr_use_cassette_mode }) do
Expand All @@ -21,14 +23,6 @@ def call(env)

private

def configuration
CypressOnRails.configuration
end

def logger
configuration.logger
end

def fetch_request_cassette(request)
if request.path.start_with?('/graphql') && request.params.key?('operation')
"#{request.path}/#{request.params['operation']}"
Expand Down

0 comments on commit 0ce2cb6

Please sign in to comment.