Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,10 @@ jobs:
bundler-cache: true
- name: Run rake
run: bundle exec rake

lint:
runs-on: ubuntu-latest
steps:
- name: Lint with Standard
uses: standardrb/standard-ruby-action@v1
with:
autofix: false
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/.bundle/
/.idea/
/.yardoc
/_yardoc/
/coverage/
Expand Down
8 changes: 0 additions & 8 deletions .idea/.gitignore

This file was deleted.

4 changes: 0 additions & 4 deletions .idea/misc.xml

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/modules.xml

This file was deleted.

41 changes: 0 additions & 41 deletions .idea/rspec-common.iml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

4 changes: 2 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ require "bundler/setup"

require "rspec/core/rake_task"
RSpec::Core::RakeTask.new(:spec)
task default: :spec

require "standard/rake"

task default: %w[spec standard]
task default: :standard unless ENV["CI"]
2 changes: 0 additions & 2 deletions lib/rspec/common/extensions/active_storage/service/memory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@
module ActiveStorage
class Service::MemoryService < Service
# We explicity do NOT want the super behavior from ActiveStorage
# rubocop:disable Lint/MissingSuper
def initialize(**config)
end
# rubocop:enable Lint/MissingSuper

def reset!
@storage = nil
Expand Down
2 changes: 0 additions & 2 deletions lib/rspec/common/extensions/elasticsearch/client.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# rubocop:disable Lint/SuppressedException
begin
require "elasticsearch/model"

Expand Down Expand Up @@ -63,4 +62,3 @@ def respond_to_missing?(*)
def elasticsearch_return(*args, **kwargs)
Doubles::Elasticsearch::Client.return(*args, **kwargs)
end
# rubocop:enable Lint/SuppressedException
2 changes: 0 additions & 2 deletions lib/rspec/common/extensions/elasticsearch/response_builder.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# rubocop:disable Lint/SuppressedException
begin
require "elasticsearch/model"

Expand Down Expand Up @@ -32,4 +31,3 @@ def response
end
rescue LoadError
end
# rubocop:enable Lint/SuppressedException
2 changes: 0 additions & 2 deletions lib/rspec/common/helpers/controller_exceptions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#
# config.before { config.include(RSpec::Common::Helpers::ControllerExceptions, type: :controller) }

# rubocop:disable Metrics/MethodLength
module RSpec::Common
module Helpers
module ControllerExceptions
Expand All @@ -34,4 +33,3 @@ def process(...)
end
end
end
# rubocop:enable Metrics/MethodLength
4 changes: 1 addition & 3 deletions lib/rspec/common/helpers/exceptions.rb
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
module RSpec::Common
module Helpers
module Exceptions
# rubocop:disable Lint/RescueException
def fallible(suppress: :runtime)
raise ArgumentError unless %i[none runtime all].include?(suppress)

yield
rescue
raise if suppress == :none
rescue Exception
rescue Exception # standard:disable Lint/RescueException
raise unless suppress == :all
end
# rubocop:enable Lint/RescueException
end
end
end
2 changes: 0 additions & 2 deletions lib/rspec/common/matchers/elasticsearch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
end
end

# rubocop:disable Metrics/BlockLength
RSpec::Matchers.define :search_elasticsearch_index do |index|
chain :with_query do |query|
@query = query
Expand Down Expand Up @@ -99,4 +98,3 @@
message
end
end
# rubocop:enable Metrics/BlockLength
2 changes: 0 additions & 2 deletions lib/rspec/common/matchers/models.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# rubocop:disable Metrics/BlockLength
RSpec::Matchers.define :create_record do |model_class|
supports_block_expectations

Expand Down Expand Up @@ -50,4 +49,3 @@ def filter_by_proc_attributes(relation)
end
end
end
# rubocop:enable Metrics/BlockLength
2 changes: 0 additions & 2 deletions lib/rspec/common/matchers/rollbar.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# rubocop:disable Metrics/BlockLength
RSpec::Matchers.define :send_rollbar_report do |level|
supports_block_expectations

Expand Down Expand Up @@ -47,4 +46,3 @@ def failure_message
message
end
end
# rubocop:enable Metrics/BlockLength
4 changes: 0 additions & 4 deletions lib/rspec/common/matchers/views/json.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ def generate_results_for(json)
hash.dig(*keys) if hash.is_a?(Hash)
end

# rubocop:disable Naming/PredicateName
def has_keys?
hash = parent.results_for(actual)

Expand All @@ -80,7 +79,6 @@ def has_keys?
end
end
end
# rubocop:enable Naming/PredicateName
end

class JsonArrayMatcher
Expand Down Expand Up @@ -201,8 +199,6 @@ def initialize
JsonArrayMatcher.new(JsonMatcherRoot.instance)
end

# rubocop:disable Naming/PredicateName
define_method :have_json_element do |*elements|
JsonElementMatcher.new(JsonMatcherRoot.instance, *elements)
end
# rubocop:enable Naming/PredicateName
Loading