hanami-rspec 3.11.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: bb274d263b143f47cda8bf26d3e064125d57dea50a5be98b0b5182e6a952d186
4
+ data.tar.gz: e98375c2ef0d2974a1982989694e5873377bb1b5cafccf159477e5e90e963657
5
+ SHA512:
6
+ metadata.gz: 89e4a5322a0f7bafd4c8abbfd94f8edaf0e7f9ff617ac65f543ce8d2232dbdc40c33618ca3061f93b092359a0c83ea29c42039b9c64976bb6e810dceac7813fe
7
+ data.tar.gz: 8049790bcf4437f5363c94af6d41a58be5b90a5c02cea61c4f6b274180f6559a00b1271a7d566b8ef6a52c36c6304c2c24f9c9c7e25d9abdc95b360a48a56d40
@@ -0,0 +1,40 @@
1
+ name: ci
2
+
3
+ 'on':
4
+ push:
5
+ paths:
6
+ - '.github/workflows/ci.yml'
7
+ - 'lib/**'
8
+ - '*.gemspec'
9
+ - 'spec/**'
10
+ - 'Rakefile'
11
+ - 'Gemfile'
12
+ - '.rubocop.yml'
13
+ pull_request:
14
+ branches:
15
+ - master
16
+ create:
17
+
18
+ jobs:
19
+ tests:
20
+ runs-on: ubuntu-latest
21
+ strategy:
22
+ fail-fast: false
23
+ matrix:
24
+ ruby:
25
+ - '3.0'
26
+ steps:
27
+ - uses: actions/checkout@v1
28
+ - name: Install package dependencies
29
+ run: '[ -e $APT_DEPS ] || sudo apt-get install -y --no-install-recommends $APT_DEPS'
30
+ - name: Set up Ruby
31
+ uses: ruby/setup-ruby@v1
32
+ with:
33
+ ruby-version: ${{matrix.ruby}}
34
+ - name: Install latest bundler
35
+ run: |
36
+ gem install bundler --no-document
37
+ - name: Bundle install
38
+ run: bundle install --jobs 4 --retry 3
39
+ - name: Run all tests
40
+ run: bundle exec rake
data/.gitignore ADDED
@@ -0,0 +1,13 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+ .rubocop-*
10
+ Gemfile.lock
11
+
12
+ # rspec failure tracking
13
+ .rspec_status
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,26 @@
1
+ # Please keep AllCops, Bundler, Style, Metrics groups and then order cops
2
+ # alphabetically
3
+ inherit_from:
4
+ - https://raw.githubusercontent.com/hanami/devtools/main/.rubocop.yml
5
+ Layout/LineLength:
6
+ Exclude:
7
+ - Gemfile
8
+ Naming/MethodParameterName:
9
+ AllowedNames:
10
+ - fs
11
+ Naming/HeredocDelimiterNaming:
12
+ Enabled: false
13
+ Style/AccessorGrouping:
14
+ Enabled: false
15
+ Style/BlockDelimiters:
16
+ Enabled: false
17
+ Style/CommentedKeyword:
18
+ Enabled: false
19
+ Style/LambdaCall:
20
+ Enabled: false
21
+ Style/TrailingCommaInArguments:
22
+ Enabled: false
23
+ Style/TrailingCommaInArrayLiteral:
24
+ Enabled: false
25
+ Style/TrailingCommaInHashLiteral:
26
+ Enabled: false
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## v3.11.0.beta1 - 2022-07-20
2
+
3
+ ### Added
4
+
5
+ - [Luca Guidi] Hook into `hanami install` to setup RSpec + Rack::Test
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at me@lucaguidi.com. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Gemfile ADDED
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+ gemspec
5
+
6
+ unless ENV["CI"]
7
+ gem "byebug", require: false, platforms: :mri
8
+ gem "yard", require: false
9
+ end
10
+
11
+ gem "dry-files", require: false, git: "https://github.com/dry-rb/dry-files.git", branch: "main"
12
+ gem "hanami-cli", require: false, git: "https://github.com/hanami/cli.git", branch: "main"
13
+ gem "hanami", require: false, git: "https://github.com/hanami/hanami.git", branch: "main"
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2021 Luca Guidi
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,64 @@
1
+ # Hanami::RSpec
2
+
3
+ RSpec and testing support for [full-stack Hanami applications](`https://github.com/hanami/hanami`).
4
+
5
+ ## Status
6
+
7
+ [![Gem Version](https://badge.fury.io/rb/hanami-rspec.svg)](https://badge.fury.io/rb/hanami-rspec)
8
+ [![CI](https://github.com/hanami/rspec/workflows/ci/badge.svg?branch=main)](https://github.com/hanami/rspec/actions?query=workflow%3Aci+branch%3Amain)
9
+ [![Depfu](https://badges.depfu.com/badges/a8545fb67cf32a2c75b6227bc0821027/overview.svg)](https://depfu.com/github/hanami/rspec?project=Bundler)
10
+
11
+ ## Version
12
+
13
+ Versioning of this gem follows RSpec.
14
+
15
+ ## Contact
16
+
17
+ - Home page: http://hanamirb.org
18
+ - Mailing List: http://hanamirb.org/mailing-list
19
+ - Bugs/Issues: https://github.com/hanami/rspec/issues
20
+ - Support: http://stackoverflow.com/questions/tagged/hanami
21
+ - Chat: http://chat.hanamirb.org
22
+
23
+ ## Rubies
24
+
25
+ **Hanami::RSpec** supports Ruby (MRI) 3.0+
26
+
27
+ ## Installation
28
+
29
+ Add this line to your application's Gemfile:
30
+
31
+ ```ruby
32
+ group :cli, :development, :test do
33
+ gem "hanami-rspec"
34
+ end
35
+ ```
36
+
37
+ And then execute:
38
+
39
+ $ bundle install
40
+ $ bundle exec hanami setup
41
+
42
+ ## Usage
43
+
44
+ ## Development
45
+
46
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
47
+
48
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
49
+
50
+ ## Contributing
51
+
52
+ Bug reports and pull requests are welcome on GitHub at https://github.com/hanami/rspec. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/hanami/rspec/blob/main/CODE_OF_CONDUCT.md).
53
+
54
+ ## License
55
+
56
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
57
+
58
+ ## Code of Conduct
59
+
60
+ Everyone interacting in the `Hanami::RSpec` project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/hanami/rspec/blob/main/CODE_OF_CONDUCT.md).
61
+
62
+ ## Copyright
63
+
64
+ Copyright © 2014-2022 Hanami Team – Released under MIT License
data/Rakefile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ require "rubocop/rake_task"
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ task default: %i[spec rubocop]
data/bin/console ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "bundler/setup"
5
+ require "hanami/rspec"
6
+
7
+ # You can add fixtures and/or initialization code here to make experimenting
8
+ # with your gem easier. You can also use a different console, if you like.
9
+
10
+ # (If you use this, don't forget to add pry to your Gemfile!)
11
+ # require "pry"
12
+ # Pry.start
13
+
14
+ require "irb"
15
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/hanami/rspec/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "hanami-rspec"
7
+ spec.version = Hanami::RSpec::VERSION
8
+ spec.authors = ["Luca Guidi"]
9
+ spec.email = ["me@lucaguidi.com"]
10
+
11
+ spec.summary = "Hanami RSpec"
12
+ spec.description = "Hanami RSpec generators and Rake tasks"
13
+ spec.homepage = "https://hanamirb.org"
14
+ spec.license = "MIT"
15
+ spec.required_ruby_version = Gem::Requirement.new(">= 3.0.0")
16
+
17
+ spec.metadata["allowed_push_host"] = "https://rubygems.org"
18
+
19
+ spec.metadata["homepage_uri"] = spec.homepage
20
+ spec.metadata["source_code_uri"] = "https://github.com/hanami/rspec"
21
+ spec.metadata["changelog_uri"] = "https://github.com/hanami/rspec/blob/master/CHANGELOG.md"
22
+
23
+ # Specify which files should be added to the gem when it is released.
24
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
25
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
26
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
27
+ end
28
+ spec.bindir = "exe"
29
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
30
+ spec.require_paths = ["lib"]
31
+
32
+ spec.add_dependency "hanami-cli", "~> 2.0.0.alpha"
33
+ spec.add_dependency "rspec", "~> 3.11"
34
+ spec.add_dependency "rake", "~> 13.0"
35
+
36
+ spec.add_development_dependency "rubocop", "~> 1.11"
37
+ spec.metadata["rubygems_mfa_required"] = "true"
38
+ end
@@ -0,0 +1,88 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "hanami/cli"
4
+ require "shellwords"
5
+ require "hanami/cli/generators/context"
6
+ require_relative "./generators"
7
+
8
+ module Hanami
9
+ module RSpec
10
+ module Commands
11
+ class Install < Hanami::CLI::Command
12
+ def call(*, **)
13
+ append_gemfile
14
+ copy_dotrspec
15
+ copy_spec_helper
16
+ copy_support_rspec
17
+ copy_support_requests
18
+
19
+ generate_request_spec
20
+ end
21
+
22
+ private
23
+
24
+ def append_gemfile
25
+ fs.append(
26
+ fs.expand_path("Gemfile"),
27
+ fs.read(
28
+ fs.expand_path(fs.join("generators", "gemfile"), __dir__)
29
+ ),
30
+ )
31
+ end
32
+
33
+ def copy_dotrspec
34
+ fs.cp(
35
+ fs.expand_path(fs.join("generators", "dotrspec"), __dir__),
36
+ fs.expand_path(fs.join(".rspec")),
37
+ )
38
+ end
39
+
40
+ def copy_spec_helper
41
+ fs.cp(
42
+ fs.expand_path(fs.join("generators", "helper.rb"), __dir__),
43
+ fs.expand_path(fs.join("spec", "spec_helper.rb"))
44
+ )
45
+ end
46
+
47
+ def copy_support_rspec
48
+ fs.cp(
49
+ fs.expand_path(fs.join("generators", "support_rspec.rb"), __dir__),
50
+ fs.expand_path(fs.join("spec", "support", "rspec.rb"))
51
+ )
52
+ end
53
+
54
+ def copy_support_requests
55
+ fs.cp(
56
+ fs.expand_path(fs.join("generators", "support_requests.rb"), __dir__),
57
+ fs.expand_path(fs.join("spec", "support", "requests.rb"))
58
+ )
59
+ end
60
+
61
+ def generate_request_spec
62
+ fs.cp(
63
+ fs.expand_path(fs.join("generators", "request.rb"), __dir__),
64
+ fs.expand_path(fs.join("spec", "requests", "root_spec.rb"))
65
+ )
66
+ end
67
+ end
68
+
69
+ module Generate
70
+ class Slice < Hanami::CLI::Command
71
+ # FIXME: dry-cli kwargs aren't correctly forwarded in Ruby 3
72
+ def call(options, **)
73
+ slice = inflector.underscore(Shellwords.shellescape(options[:name]))
74
+
75
+ out.puts "generating #{slice} (rspec)"
76
+ generator = Generators::Slice.new(fs: fs, inflector: inflector)
77
+ generator.call(slice)
78
+ end
79
+ end
80
+ end
81
+ end
82
+ end
83
+ end
84
+
85
+ if Hanami::CLI.within_hanami_app?
86
+ Hanami::CLI.after "install", Hanami::RSpec::Commands::Install
87
+ # Hanami::CLI.after "generate slice", Hanami::RSpec::Commands::Generate::Slice
88
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Hanami
4
+ module RSpec
5
+ class Error < StandardError
6
+ end
7
+ end
8
+ end
@@ -0,0 +1 @@
1
+ --require spec_helper
@@ -0,0 +1,4 @@
1
+
2
+ group :test do
3
+ gem "rack-test"
4
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "pathname"
4
+ SPEC_ROOT = Pathname(__dir__).realpath.freeze
5
+
6
+ ENV["HANAMI_ENV"] ||= "test"
7
+ require "hanami/prepare"
8
+
9
+ require_relative "support/rspec"
10
+ require_relative "support/requests"
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ RSpec.describe "Root", type: :request do
4
+ it "is successful" do
5
+ get "/"
6
+
7
+ # Find me in `config/routes.rb`
8
+ expect(last_response).to be_successful
9
+ expect(last_response.body).to eq("Hello from Hanami")
10
+ end
11
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "slices/<%= underscored_slice_name %>/action"
4
+
5
+ RSpec.describe <%= classified_slice_name %>::Action do
6
+ end
File without changes
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "slices/<%= underscored_slice_name %>/repository"
4
+
5
+ RSpec.describe <%= classified_slice_name %>::Repository do
6
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "slices/<%= underscored_slice_name %>/view"
4
+
5
+ RSpec.describe <%= classified_slice_name %>::View do
6
+ end
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "erb"
4
+ require "hanami/cli/generators/app/slice_context"
5
+
6
+ module Hanami
7
+ module RSpec
8
+ module Generators
9
+ class Slice
10
+ def initialize(fs:, inflector:)
11
+ @fs = fs
12
+ @inflector = inflector
13
+ end
14
+
15
+ def call(slice, context: Hanami::CLI::Generators::App::SliceContext.new(inflector, nil, slice, nil)) # rubocop:disable Metrics/AbcSize
16
+ fs.write("spec/#{slice}/action_spec.rb", t("action_spec.erb", context))
17
+ fs.write("spec/#{slice}/view_spec.rb", t("view_spec.erb", context))
18
+ fs.write("spec/#{slice}/repository_spec.rb", t("repository_spec.erb", context))
19
+
20
+ fs.write("spec/#{slice}/actions/.keep", t("keep.erb", context))
21
+ fs.write("spec/#{slice}/views/.keep", t("keep.erb", context))
22
+ fs.write("spec/#{slice}/templates/.keep", t("keep.erb", context))
23
+ fs.write("spec/#{slice}/templates/layouts/.keep", t("keep.erb", context))
24
+ fs.write("spec/#{slice}/entities/.keep", t("keep.erb", context))
25
+ fs.write("spec/#{slice}/repositories/.keep", t("keep.erb", context))
26
+ end
27
+
28
+ private
29
+
30
+ attr_reader :fs
31
+
32
+ attr_reader :inflector
33
+
34
+ def template(path, context)
35
+ require "erb"
36
+
37
+ ERB.new(
38
+ File.read(__dir__ + "/slice/#{path}")
39
+ ).result(context.ctx)
40
+ end
41
+
42
+ alias_method :t, :template
43
+ end
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "rack/test"
4
+
5
+ RSpec.shared_context "Hanami app" do
6
+ let(:app) { Hanami.app }
7
+ end
8
+
9
+ RSpec.configure do |config|
10
+ config.include Rack::Test::Methods, type: :request
11
+ config.include_context "Hanami app", type: :request
12
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ RSpec.configure do |config|
4
+ config.expect_with :rspec do |expectations|
5
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
6
+ end
7
+
8
+ config.mock_with :rspec do |mocks|
9
+ mocks.verify_partial_doubles = true
10
+ end
11
+
12
+ config.shared_context_metadata_behavior = :apply_to_host_groups
13
+
14
+ config.filter_run_when_matching :focus
15
+
16
+ config.disable_monkey_patching!
17
+ config.warnings = true
18
+
19
+ if config.files_to_run.one?
20
+ config.default_formatter = "doc"
21
+ end
22
+
23
+ config.profile_examples = 10
24
+
25
+ config.order = :random
26
+ Kernel.srand config.seed
27
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Hanami
4
+ module RSpec
5
+ module Generators
6
+ require_relative "./generators/slice"
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "hanami/cli/rake_tasks"
4
+
5
+ Hanami::CLI::RakeTasks.register_tasks do
6
+ require "rspec/core/rake_task"
7
+ ::RSpec::Core::RakeTask.new(:spec)
8
+
9
+ task default: :spec
10
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Hanami
4
+ module RSpec
5
+ VERSION = "3.11.0.beta1"
6
+ end
7
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Hanami
4
+ module RSpec
5
+ require_relative "rspec/version"
6
+ require_relative "rspec/error"
7
+ require_relative "rspec/commands"
8
+ require_relative "rspec/rake_tasks"
9
+ end
10
+ end
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "./hanami/rspec"
metadata ADDED
@@ -0,0 +1,135 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: hanami-rspec
3
+ version: !ruby/object:Gem::Version
4
+ version: 3.11.0.beta1
5
+ platform: ruby
6
+ authors:
7
+ - Luca Guidi
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2022-07-20 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: hanami-cli
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 2.0.0.alpha
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 2.0.0.alpha
27
+ - !ruby/object:Gem::Dependency
28
+ name: rspec
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '3.11'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '3.11'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '13.0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '13.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rubocop
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '1.11'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '1.11'
69
+ description: Hanami RSpec generators and Rake tasks
70
+ email:
71
+ - me@lucaguidi.com
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - ".github/workflows/ci.yml"
77
+ - ".gitignore"
78
+ - ".rspec"
79
+ - ".rubocop.yml"
80
+ - CHANGELOG.md
81
+ - CODE_OF_CONDUCT.md
82
+ - Gemfile
83
+ - LICENSE.txt
84
+ - README.md
85
+ - Rakefile
86
+ - bin/console
87
+ - bin/setup
88
+ - hanami-rspec.gemspec
89
+ - lib/hanami-rspec.rb
90
+ - lib/hanami/rspec.rb
91
+ - lib/hanami/rspec/commands.rb
92
+ - lib/hanami/rspec/error.rb
93
+ - lib/hanami/rspec/generators.rb
94
+ - lib/hanami/rspec/generators/dotrspec
95
+ - lib/hanami/rspec/generators/gemfile
96
+ - lib/hanami/rspec/generators/helper.rb
97
+ - lib/hanami/rspec/generators/request.rb
98
+ - lib/hanami/rspec/generators/slice.rb
99
+ - lib/hanami/rspec/generators/slice/action_spec.erb
100
+ - lib/hanami/rspec/generators/slice/keep.erb
101
+ - lib/hanami/rspec/generators/slice/repository_spec.erb
102
+ - lib/hanami/rspec/generators/slice/view_spec.erb
103
+ - lib/hanami/rspec/generators/support_requests.rb
104
+ - lib/hanami/rspec/generators/support_rspec.rb
105
+ - lib/hanami/rspec/rake_tasks.rb
106
+ - lib/hanami/rspec/version.rb
107
+ homepage: https://hanamirb.org
108
+ licenses:
109
+ - MIT
110
+ metadata:
111
+ allowed_push_host: https://rubygems.org
112
+ homepage_uri: https://hanamirb.org
113
+ source_code_uri: https://github.com/hanami/rspec
114
+ changelog_uri: https://github.com/hanami/rspec/blob/master/CHANGELOG.md
115
+ rubygems_mfa_required: 'true'
116
+ post_install_message:
117
+ rdoc_options: []
118
+ require_paths:
119
+ - lib
120
+ required_ruby_version: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: 3.0.0
125
+ required_rubygems_version: !ruby/object:Gem::Requirement
126
+ requirements:
127
+ - - ">"
128
+ - !ruby/object:Gem::Version
129
+ version: 1.3.1
130
+ requirements: []
131
+ rubygems_version: 3.3.3
132
+ signing_key:
133
+ specification_version: 4
134
+ summary: Hanami RSpec
135
+ test_files: []