From 3640593e0fdc799d560e7b7c9ee5ef53fcc93226 Mon Sep 17 00:00:00 2001 From: ojab Date: Mon, 28 Mar 2022 01:34:22 +0300 Subject: [PATCH] fix: Fixup ruby warnings (#262) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ``` …/configuration/service_provider_dsl.rb:67: warning: `&' interpreted as argument prefix …/pact_uri.rb:6: warning: parentheses after method name is interpreted as an argument list, not a decomposed argument …/configuration/message_provider_dsl.rb:49: warning: `&' interpreted as argument prefix …/state/provider_state.rb:15: warning: `&' interpreted as argument prefix …/state/provider_state.rb:19: warning: `&' interpreted as argument prefix …/state/provider_state.rb:63: warning: assigned but unused variable - fullname …/state/provider_state.rb:84: warning: `&' interpreted as argument prefix …/state/provider_state.rb:88: warning: `&' interpreted as argument prefix ``` --- .../provider/configuration/message_provider_dsl.rb | 2 +- .../provider/configuration/service_provider_dsl.rb | 2 +- lib/pact/provider/pact_uri.rb | 2 +- lib/pact/provider/state/provider_state.rb | 10 +++++----- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/pact/provider/configuration/message_provider_dsl.rb b/lib/pact/provider/configuration/message_provider_dsl.rb index 0a886ae1..dc45d899 100644 --- a/lib/pact/provider/configuration/message_provider_dsl.rb +++ b/lib/pact/provider/configuration/message_provider_dsl.rb @@ -46,7 +46,7 @@ def honours_pact_with consumer_name, options = {}, &block end def honours_pacts_from_pact_broker &block - create_pact_verification_from_broker &block + create_pact_verification_from_broker(&block) end def builder &block diff --git a/lib/pact/provider/configuration/service_provider_dsl.rb b/lib/pact/provider/configuration/service_provider_dsl.rb index 60f24a33..3933eab9 100644 --- a/lib/pact/provider/configuration/service_provider_dsl.rb +++ b/lib/pact/provider/configuration/service_provider_dsl.rb @@ -64,7 +64,7 @@ def honours_pact_with consumer_name, options = {}, &block end def honours_pacts_from_pact_broker &block - create_pact_verification_from_broker &block + create_pact_verification_from_broker(&block) end end diff --git a/lib/pact/provider/pact_uri.rb b/lib/pact/provider/pact_uri.rb index 56640a6e..282ffe27 100644 --- a/lib/pact/provider/pact_uri.rb +++ b/lib/pact/provider/pact_uri.rb @@ -3,7 +3,7 @@ module Provider class PactURI attr_reader :uri, :options, :metadata - def initialize (uri, options = nil, metadata = nil) + def initialize(uri, options = nil, metadata = nil) @uri = uri @options = options || {} @metadata = metadata || {} # make sure it's not nil if nil is passed in diff --git a/lib/pact/provider/state/provider_state.rb b/lib/pact/provider/state/provider_state.rb index 7c4a9043..92b4b1ce 100644 --- a/lib/pact/provider/state/provider_state.rb +++ b/lib/pact/provider/state/provider_state.rb @@ -12,11 +12,11 @@ def provider_state name, &block end def set_up &block - ProviderStates.base_provider_state.register.register_set_up &block + ProviderStates.base_provider_state.register.register_set_up(&block) end def tear_down &block - ProviderStates.base_provider_state.register_tear_down &block + ProviderStates.base_provider_state.register_tear_down(&block) end def provider_states_for name, &block @@ -60,7 +60,7 @@ def self.get_base opts = {} end def self.namespaced_name name, options = {} - fullname = options[:for] ? "#{options[:for]}.#{name}" : name + options[:for] ? "#{options[:for]}.#{name}" : name end end @@ -81,11 +81,11 @@ def initialize name, namespace, &block dsl do def set_up &block - self.register_set_up &block + self.register_set_up(&block) end def tear_down &block - self.register_tear_down &block + self.register_tear_down(&block) end def no_op