hanami-rspec 2.1.0.rc1 → 2.1.0.rc2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/hanami-rspec.gemspec +1 -1
- data/lib/hanami/rspec/commands.rb +23 -3
- data/lib/hanami/rspec/generators/gemfile +1 -0
- data/lib/hanami/rspec/generators/gitignore +1 -0
- data/lib/hanami/rspec/generators/helper.rb +1 -0
- data/lib/hanami/rspec/generators/support_features.rb +5 -0
- data/lib/hanami/rspec/generators/support_requests.rb +3 -2
- data/lib/hanami/rspec/generators/support_rspec.rb +36 -2
- data/lib/hanami/rspec/version.rb +1 -1
- metadata +7 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 213e19981cb640eec5aca246cafc481ad481731099a0c58b391fcb41a17300c7
|
4
|
+
data.tar.gz: a67b4291aa541a722e5460bf403aa9f203d770476c3b3a0b823c7cb056f676e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c4d92b324e878aa771f045e592b1e35e6bb80f375dba7b9ac80bab120d29cb1ac06e036006dfe3ab504510b437f6ab99af94aed2d8b949ea0289f4e5bbbf604
|
7
|
+
data.tar.gz: 984fe9016a17887063c2e4e1545cf9b5344fb3faa7ce42cc22516912cdd1753c6f33cb99d72c33f264855df804266f81925c73b5e09b13b3bac64a850fdd1f00
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,17 @@
|
|
2
2
|
|
3
3
|
RSpec support for Hanami
|
4
4
|
|
5
|
+
## v2.1.0.rc2 - 2023-11-08
|
6
|
+
|
7
|
+
### Added
|
8
|
+
|
9
|
+
- [Tim Riley] Skip generating tests for `hanami generate` when `--skip-tests` CLI option is given.
|
10
|
+
- [Tim Riley] Install Capybara and generate `spec/support/capybara.rb` in `hanami install` hook.
|
11
|
+
|
12
|
+
### Changed
|
13
|
+
|
14
|
+
- [Tim Riley] Add explanatory code comments to `spec/support/rspec.rb` generated in `hanami install` hook.
|
15
|
+
|
5
16
|
## v2.1.0.rc1 - 2023-11-01
|
6
17
|
|
7
18
|
### Added
|
data/hanami-rspec.gemspec
CHANGED
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
30
30
|
spec.require_paths = ["lib"]
|
31
31
|
|
32
|
-
spec.add_dependency "hanami-cli", "~> 2.
|
32
|
+
spec.add_dependency "hanami-cli", "~> 2.1.rc"
|
33
33
|
spec.add_dependency "rspec", "~> 3.12"
|
34
34
|
spec.add_dependency "rake", "~> 13.0"
|
35
35
|
spec.add_dependency "zeitwerk", "~> 2.6"
|
@@ -14,9 +14,11 @@ module Hanami
|
|
14
14
|
# @api private
|
15
15
|
def call(*, **)
|
16
16
|
append_gemfile
|
17
|
+
append_gitignore
|
17
18
|
copy_dotrspec
|
18
19
|
copy_spec_helper
|
19
20
|
copy_support_rspec
|
21
|
+
copy_support_features
|
20
22
|
copy_support_requests
|
21
23
|
|
22
24
|
generate_request_spec
|
@@ -27,9 +29,14 @@ module Hanami
|
|
27
29
|
def append_gemfile
|
28
30
|
fs.append(
|
29
31
|
fs.expand_path("Gemfile"),
|
30
|
-
fs.read(
|
31
|
-
|
32
|
-
|
32
|
+
fs.read(fs.expand_path(fs.join("generators", "gemfile"), __dir__))
|
33
|
+
)
|
34
|
+
end
|
35
|
+
|
36
|
+
def append_gitignore
|
37
|
+
fs.append(
|
38
|
+
fs.expand_path(".gitignore"),
|
39
|
+
fs.read(fs.expand_path(fs.join("generators", "gitignore"), __dir__))
|
33
40
|
)
|
34
41
|
end
|
35
42
|
|
@@ -54,6 +61,13 @@ module Hanami
|
|
54
61
|
)
|
55
62
|
end
|
56
63
|
|
64
|
+
def copy_support_features
|
65
|
+
fs.cp(
|
66
|
+
fs.expand_path(fs.join("generators", "support_features.rb"), __dir__),
|
67
|
+
fs.expand_path(fs.join("spec", "support", "features.rb"))
|
68
|
+
)
|
69
|
+
end
|
70
|
+
|
57
71
|
def copy_support_requests
|
58
72
|
fs.cp(
|
59
73
|
fs.expand_path(fs.join("generators", "support_requests.rb"), __dir__),
|
@@ -91,6 +105,9 @@ module Hanami
|
|
91
105
|
# @api private
|
92
106
|
def call(options, **)
|
93
107
|
# FIXME: dry-cli kwargs aren't correctly forwarded in Ruby 3
|
108
|
+
|
109
|
+
return if options[:skip_tests]
|
110
|
+
|
94
111
|
slice = inflector.underscore(Shellwords.shellescape(options[:slice])) if options[:slice]
|
95
112
|
name = inflector.underscore(Shellwords.shellescape(options[:name]))
|
96
113
|
*controller, action = name.split(ACTION_SEPARATOR)
|
@@ -107,6 +124,9 @@ module Hanami
|
|
107
124
|
# @api private
|
108
125
|
def call(options, **)
|
109
126
|
# FIXME: dry-cli kwargs aren't correctly forwarded in Ruby 3
|
127
|
+
|
128
|
+
return if options[:skip_tests]
|
129
|
+
|
110
130
|
slice = inflector.underscore(Shellwords.shellescape(options[:slice])) if options[:slice]
|
111
131
|
name = inflector.underscore(Shellwords.shellescape(options[:name]))
|
112
132
|
|
@@ -0,0 +1 @@
|
|
1
|
+
spec/examples.txt
|
@@ -2,11 +2,12 @@
|
|
2
2
|
|
3
3
|
require "rack/test"
|
4
4
|
|
5
|
-
RSpec.shared_context "
|
5
|
+
RSpec.shared_context "Rack::Test" do
|
6
|
+
# Define the app for Rack::Test requests
|
6
7
|
let(:app) { Hanami.app }
|
7
8
|
end
|
8
9
|
|
9
10
|
RSpec.configure do |config|
|
10
11
|
config.include Rack::Test::Methods, type: :request
|
11
|
-
config.include_context "
|
12
|
+
config.include_context "Rack::Test", type: :request
|
12
13
|
end
|
@@ -1,27 +1,61 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
RSpec.configure do |config|
|
4
|
+
# Use the recommended non-monkey patched syntax.
|
5
|
+
config.disable_monkey_patching!
|
6
|
+
|
7
|
+
# Use and configure rspec-expectations.
|
4
8
|
config.expect_with :rspec do |expectations|
|
9
|
+
# This option will default to `true` in RSpec 4.
|
5
10
|
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
6
11
|
end
|
7
12
|
|
13
|
+
# Use and configure rspec-mocks.
|
8
14
|
config.mock_with :rspec do |mocks|
|
15
|
+
# Prevents you from mocking or stubbing a method that does not exist on a
|
16
|
+
# real object.
|
9
17
|
mocks.verify_partial_doubles = true
|
10
18
|
end
|
11
19
|
|
20
|
+
# This option will default to `:apply_to_host_groups` in RSpec 4.
|
12
21
|
config.shared_context_metadata_behavior = :apply_to_host_groups
|
13
22
|
|
23
|
+
# Limit a spec run to individual examples or groups you care about by tagging
|
24
|
+
# them with `:focus` metadata. When nothing is tagged with `:focus`, all
|
25
|
+
# examples get run.
|
26
|
+
#
|
27
|
+
# RSpec also provides aliases for `it`, `describe`, and `context` that include
|
28
|
+
# `:focus` metadata: `fit`, `fdescribe` and `fcontext`, respectively.
|
14
29
|
config.filter_run_when_matching :focus
|
15
30
|
|
16
|
-
|
17
|
-
|
31
|
+
# Allow RSpec to persist some state between runs in order to support the
|
32
|
+
# `--only-failures` and `--next-failure` CLI options. We recommend you
|
33
|
+
# configure your source control system to ignore this file.
|
34
|
+
config.example_status_persistence_file_path = "spec/examples.txt"
|
18
35
|
|
36
|
+
# Uncomment this to enable warnings. This is recommended, but in some cases
|
37
|
+
# may be too noisy due to issues in dependencies.
|
38
|
+
# config.warnings = true
|
39
|
+
|
40
|
+
# Show more verbose output when running an individual spec file.
|
19
41
|
if config.files_to_run.one?
|
20
42
|
config.default_formatter = "doc"
|
21
43
|
end
|
22
44
|
|
45
|
+
# Print the 10 slowest examples and example groups at the end of the spec run,
|
46
|
+
# to help surface which specs are running particularly slow.
|
23
47
|
config.profile_examples = 10
|
24
48
|
|
49
|
+
# Run specs in random order to surface order dependencies. If you find an
|
50
|
+
# order dependency and want to debug it, you can fix the order by providing
|
51
|
+
# the seed, which is printed after each run:
|
52
|
+
#
|
53
|
+
# --seed 1234
|
25
54
|
config.order = :random
|
55
|
+
|
56
|
+
# Seed global randomization in this process using the `--seed` CLI option.
|
57
|
+
# This allows you to use `--seed` to deterministically reproduce test failures
|
58
|
+
# related to randomization by passing the same `--seed` value as the one that
|
59
|
+
# triggered the failure.
|
26
60
|
Kernel.srand config.seed
|
27
61
|
end
|
data/lib/hanami/rspec/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hanami-rspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.0.
|
4
|
+
version: 2.1.0.rc2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luca Guidi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-11-
|
11
|
+
date: 2023-11-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hanami-cli
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 2.1.rc
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 2.1.rc
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rspec
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -108,6 +108,7 @@ files:
|
|
108
108
|
- lib/hanami/rspec/generators/action/action_spec.erb
|
109
109
|
- lib/hanami/rspec/generators/dotrspec
|
110
110
|
- lib/hanami/rspec/generators/gemfile
|
111
|
+
- lib/hanami/rspec/generators/gitignore
|
111
112
|
- lib/hanami/rspec/generators/helper.rb
|
112
113
|
- lib/hanami/rspec/generators/part.rb
|
113
114
|
- lib/hanami/rspec/generators/part/part_base_spec.erb
|
@@ -120,6 +121,7 @@ files:
|
|
120
121
|
- lib/hanami/rspec/generators/slice/keep.erb
|
121
122
|
- lib/hanami/rspec/generators/slice/repository_spec.erb
|
122
123
|
- lib/hanami/rspec/generators/slice/view_spec.erb
|
124
|
+
- lib/hanami/rspec/generators/support_features.rb
|
123
125
|
- lib/hanami/rspec/generators/support_requests.rb
|
124
126
|
- lib/hanami/rspec/generators/support_rspec.rb
|
125
127
|
- lib/hanami/rspec/rake_tasks.rb
|
@@ -148,7 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
148
150
|
- !ruby/object:Gem::Version
|
149
151
|
version: 1.3.1
|
150
152
|
requirements: []
|
151
|
-
rubygems_version: 3.4.
|
153
|
+
rubygems_version: 3.4.21
|
152
154
|
signing_key:
|
153
155
|
specification_version: 4
|
154
156
|
summary: Hanami RSpec
|