lesli_testing 1.3.1 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2eaf2b1632b83fa53d61b2d9636bf1e07516820e4f7262575b776942678a8b26
4
- data.tar.gz: c8a25dfcd841b88eb11c391942ab4f61bf8b2a1b8442583526f8a69adbd6f188
3
+ metadata.gz: 88698ef1e9d9deca5342518ce5b98a148f90fe3188598e8207555a379563ef36
4
+ data.tar.gz: 839d2855e41e179d6c50d5c62244c3edce13ebad39bd60039dae25886367d638
5
5
  SHA512:
6
- metadata.gz: b3eff287825f687fd6e5d994b5b201e72ddcaf32eae807728c74fd76f7aa0f0ee71a2f165be91107179286f309d77634c5e22bab7bd0a49be74d052f398e0363
7
- data.tar.gz: d19b542cc05c2205a963837bb35253f4e061bc5ed5124fe4c88370a9ce0961dace5796f4a3292e2ca7e7f4f3bd86df87fa1fb592ccab31c7f16ed33c57da13aa
6
+ metadata.gz: d5d712746d0f43f32991cc0823af12b1418f29c943f8eeddb1a97fc8f712d570b083e7a8b32617494a1c13617d29286e35fafab7dba7ea1cd5e46604cba52853
7
+ data.tar.gz: 1d60e86d118f5f8859cb5360d3fa01d5c3a35c0e47a087bcd461f224332c77a634322244aad8c08fbf567ce35ab960dcdd6e024bcbb082d584a8996bf9441dc7
@@ -37,8 +37,7 @@ module LesliTesting
37
37
  # Only run this if we are in the test environment
38
38
  unless Rails.env.production?
39
39
 
40
- # 1. Define the dependencies you want to automatically include
41
- # You can add more gems to this list as your ecosystem grows
40
+ # Lesli provides the shared schema required by every engine.
42
41
  dependencies = ["Lesli"]
43
42
 
44
43
  dependencies.each do |gem_name|
@@ -51,16 +50,16 @@ module LesliTesting
51
50
 
52
51
  # Append to the main app's migration paths if the directory exists
53
52
  if Dir.exist?(migration_path)
54
- app.config.paths["db/migrate"] << migration_path
53
+ registered_paths = app.config.paths["db/migrate"].expanded
54
+ unless registered_paths.include?(migration_path)
55
+ app.config.paths["db/migrate"] << migration_path
56
+ end
55
57
  end
56
58
  end
57
59
  rescue StandardError => e
58
60
  puts "LesliTesting: Could not load migrations for #{gem_name}: #{e.message}"
59
61
  end
60
62
  end
61
-
62
- # 2. Clean up duplicates
63
- app.config.paths["db/migrate"].uniq!
64
63
  end
65
64
  end
66
65
  end
@@ -156,7 +156,6 @@ module LesliTesting
156
156
  if failure.is_a?(Minitest::Assertion)
157
157
  result.failure.message.to_s.lines.each do |message|
158
158
  puts(parse_minitest_assertion_messages(message))
159
- #puts(parse_minitest_assertion_messages2(message))
160
159
  end
161
160
  end
162
161
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LesliTesting
4
- VERSION = "1.3.1"
5
- BUILD = "1776563517"
4
+ VERSION = "1.4.1"
5
+ BUILD = "1791607001"
6
6
  end
data/lib/lesli_testing.rb CHANGED
@@ -35,6 +35,13 @@ Building a better future, one line of code at a time.
35
35
 
36
36
  require_relative "lesli_testing/version"
37
37
 
38
+ begin
39
+ require "rails/engine"
40
+ require_relative "lesli_testing/engine"
41
+ rescue LoadError
42
+ # Rails is optional when LesliTesting is used by a standalone Ruby gem.
43
+ end
44
+
38
45
 
39
46
  module LesliTesting
40
47
  class Error < StandardError; end
@@ -109,7 +116,7 @@ module LesliTesting
109
116
  def configure_gems
110
117
  return if @tools_loaded
111
118
 
112
- #require "minitest"
119
+ require "minitest"
113
120
 
114
121
  # Load minitest plugin
115
122
  require "minitest/lesli_testing_plugin"
data/readme.md CHANGED
@@ -1,111 +1,168 @@
1
- <div align="center" class="documentation-header">
2
- <img width="100" alt="LesliTesting logo" src="./docs/images/testing-logo.svg" />
3
- <h3 align="center">Shared testing and coverage configuration for the Lesli Platform.</h3>
1
+ <div align="center">
2
+ <h1 align="center">
3
+ <img width="100" alt="LesliTesting" src="./docs/images/testing-logo.svg" />
4
+ </h1>
5
+ <h3 align="center">Shared testing, reporting, and coverage tools for the Lesli Framework.</h3>
4
6
  </div>
5
7
 
6
8
  <br />
7
- <hr/>
9
+
10
+ <div align="center">
11
+ <a target="_blank" href="https://github.com/LesliTech/LesliTesting/actions/workflows/main.yml">
12
+ <img alt="LesliTesting test status" src="https://img.shields.io/github/actions/workflow/status/LesliTech/LesliTesting/main.yml?branch=main&style=for-the-badge&logo=github&label=tests">
13
+ </a>
14
+ <a target="_blank" href="https://rubygems.org/gems/lesli_testing">
15
+ <img alt="Gem Version" src="https://img.shields.io/gem/v/lesli_testing?style=for-the-badge&logo=ruby">
16
+ </a>
17
+ <a target="_blank" href="https://codecov.io/github/LesliTech/LesliTesting">
18
+ <img alt="Codecov" src="https://img.shields.io/codecov/c/github/LesliTech/LesliTesting?style=for-the-badge&logo=codecov">
19
+ </a>
20
+ <a target="_blank" href="https://sonarcloud.io/project/overview?id=LesliTech_LesliTesting">
21
+ <img alt="Sonar Quality Gate" src="https://img.shields.io/sonar/quality_gate/LesliTech_LesliTesting?server=https%3A%2F%2Fsonarcloud.io&style=for-the-badge&logo=sonarqubecloud&label=Quality">
22
+ </a>
23
+ </div>
24
+
8
25
  <br />
9
26
 
27
+ <div align="center">
28
+ <img
29
+ style="width:100%;max-width:800px;border-radius:6px;"
30
+ alt="LesliTesting terminal test report"
31
+ src="./docs/images/screenshot.png" />
32
+ </div>
33
+
34
+ <br />
10
35
 
11
- ### Quick start
36
+ ---
12
37
 
13
38
  <br />
14
39
 
40
+ ## Introduction
15
41
 
16
- **Install LesliTesting gem**
42
+ LesliTesting provides the shared test configuration used across the [Lesli Framework](https://github.com/LesliTech/Lesli).
17
43
 
18
- ```shell
19
- bundle add lesli_testing
20
- ```
44
+ It standardizes Minitest output, SimpleCov profiles, coverage reports, and fixture loading for Rails applications, engines, and Ruby gems.
21
45
 
22
46
  <br />
23
47
 
24
- **Include LesliTesting in your test_helper.rb file**
25
-
26
- ```ruby
27
- ENV["RAILS_ENV"] ||= "test"
48
+ ## Features
28
49
 
50
+ - Coverage profiles for Rails applications, Rails engines, and Ruby gems
51
+ - A human-friendly Minitest reporter with per-test timing and failure details
52
+ - SimpleCov HTML, console, and Cobertura reports
53
+ - Configurable minimum coverage thresholds
54
+ - Shared base classes for integration, model, and view tests
55
+ - Automatic access to Lesli fixtures in Rails test cases
29
56
 
30
- # Load LesliTesting tools
31
- require "lesli_testing"
57
+ <br />
32
58
 
59
+ ## Quick Start
33
60
 
34
- # Configure leslitesting tools for a rails engine
35
- LesliTesting.engine("LesliShield")
61
+ Add LesliTesting to the test group:
36
62
 
63
+ ```shell
64
+ bundle add lesli_testing --group test
65
+ ```
37
66
 
38
- # Configure lesli testing tools for a rails app
39
- LesliTesting.app("LesliBuilder")
67
+ Require the gem from `test/test_helper.rb` and select exactly one profile for the project:
40
68
 
69
+ ```ruby
70
+ require "lesli_testing"
41
71
 
42
- # # Configure leslitesting tools for a ruby gem
43
- LesliTesting.gem("LesliDate")
72
+ LesliTesting.app("LesliBuilder") # Rails application
73
+ # LesliTesting.engine("LesliShield") # Rails engine
74
+ # LesliTesting.gem("LesliDate") # Standalone Ruby gem
44
75
  ```
45
76
 
46
- <br />
77
+ Load LesliTesting before the code under test when coverage is enabled. Engine suites that use the shared Rails test classes should run through `bundle exec rails test` or `bundle exec rake app:test`.
47
78
 
48
- **Run your tests D:**
79
+ Rails engines should keep a complete generated dummy application and verify eager loading locally before pushing:
49
80
 
50
81
  ```shell
51
- rails test
82
+ CI=true bundle exec rails test
83
+ ```
52
84
 
53
- # or
85
+ LesliTesting does not provide an engine's runtime dependencies. Declare dependencies such as `lesli` explicitly in the engine gemspec and Gemfile so local and CI dependency resolution match.
54
86
 
55
- COVERAGE=true rails test
87
+ Run the suite normally or enable coverage with `COVERAGE`:
56
88
 
57
- # or run like github actions
89
+ ```shell
90
+ bin/rails test
91
+ COVERAGE=true bin/rails test
58
92
 
59
- COVERAGE=true CI=true rails test
93
+ bundle exec rake
94
+ COVERAGE=true bundle exec rake
60
95
  ```
61
96
 
97
+ Set `QUIET=true` to hide individual passing-test lines while retaining the summary and failure details.
98
+
62
99
  <br />
63
100
 
64
- **Result :D**
101
+ ## Guides
65
102
 
66
- <div align="center">
67
- <img
68
- style="width:100%;max-width:800px;border-radius:6px;"
69
- alt="LesliTesting screenshot" src="./docs/images/screenshot.png" />
70
- </div>
103
+ - [Installation and configuration](https://www.lesli.dev/gems/testing/about/installation)
104
+ - [Testing Rails applications](https://www.lesli.dev/gems/testing/testing/applications)
105
+ - [Testing Rails engines](https://www.lesli.dev/gems/testing/testing/engines)
106
+ - [Testing Ruby gems](https://www.lesli.dev/gems/testing/testing/gems)
107
+ - [Reporter, coverage, fixtures, and test helpers](https://www.lesli.dev/gems/testing/about/tools)
108
+ - [Recommended project and gem structure](https://www.lesli.dev/gems/testing/about/structure)
71
109
 
72
110
  <br />
73
111
 
74
- ### Options
112
+ ## Development
75
113
 
76
- The following options can be used to customize coverage behavior in `LesliTesting`.
114
+ Clone the repository and install its dependencies:
77
115
 
78
- | Option | Type | Default | Description |
79
- | ----------------------- | ------- | ------: | ------------------------------------------ |
80
- | `coverage_missing_len` | Integer | `25` | Minimum width for missing coverage output. |
81
- | `coverage_min_coverage` | Integer | `40` | Minimum expected coverage percentage. |
116
+ ```shell
117
+ git clone https://github.com/LesliTech/LesliTesting.git
118
+ cd LesliTesting
119
+ bundle install
120
+ ```
82
121
 
83
- **Example:**
122
+ To use local source from a Lesli development workspace, reference it from the host application's `Gemfile`:
84
123
 
85
124
  ```ruby
86
- LesliTesting.configure(LesliShield, {
87
- coverage_missing_len: 30,
88
- coverage_min_coverage: 80
89
- })
125
+ gem "lesli_testing", path: "gems/LesliTesting"
126
+ ```
127
+
128
+ ### Tests
129
+
130
+ Run the default test task from the LesliTesting directory:
131
+
132
+ ```shell
133
+ bundle exec rake
134
+ ```
135
+
136
+ Run the reporter demonstration failures explicitly with `DEMO=true`:
137
+
138
+ ```shell
139
+ DEMO=true bundle exec ruby -Itest test/demo_test.rb
90
140
  ```
91
141
 
142
+ The demo command is expected to fail and is intended for visually checking failure formatting.
143
+
92
144
  <br />
93
145
 
94
- ### Documentation
95
- * [website](https://www.lesli.dev/)
96
- * [documentation](https://www.lesli.dev/gems/testing/)
146
+ ## Documentation
147
+
148
+ - [Lesli website](https://www.lesli.dev/)
149
+ - [Documentation](https://www.lesli.dev/gems/testing/)
150
+ - [Release notes](https://github.com/LesliTech/LesliTesting/releases)
151
+ - [Issue tracker](https://github.com/LesliTech/LesliTesting/issues)
152
+ - [Source code](https://github.com/LesliTech/LesliTesting)
97
153
 
154
+ <br />
98
155
 
99
- ### Connect with Lesli
156
+ ## Community
100
157
 
101
- * [X: @LesliTech](https://x.com/LesliTech)
102
- * [Email: hello@lesli.tech](hello@lesli.tech)
103
- * [Website: https://www.lesli.tech](https://www.lesli.tech)
158
+ - [X: @LesliTech](https://x.com/LesliTech)
159
+ - [hello@lesli.tech](mailto:hello@lesli.tech)
160
+ - [https://www.lesli.tech](https://www.lesli.tech)
104
161
 
105
162
  <br />
106
163
 
107
- ### License
108
- -------
164
+ ## License
165
+
109
166
  Copyright (c) 2026, Lesli Technologies, S. A.
110
167
 
111
168
  This program is free software: you can redistribute it and/or modify
@@ -119,17 +176,16 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
119
176
  GNU General Public License for more details.
120
177
 
121
178
  You should have received a copy of the GNU General Public License
122
- along with this program. If not, see http://www.gnu.org/licenses/.
179
+ along with this program. If not, see [https://www.gnu.org/licenses/](https://www.gnu.org/licenses/).
180
+
181
+ The complete license text is available in the [license file](./license).
182
+
183
+ ---
123
184
 
124
- <hr />
125
185
  <br />
126
186
  <br />
127
187
 
128
- <div align="center" class="has-text-centered">
129
- <img width="80" alt="Lesli logo" src="https://cdn.lesli.tech/lesli/brand/app-icon.svg" />
130
- <h4 align="center" class="mt-0">
131
- The Open-Source SaaS Development Framework for Ruby on Rails.
132
- </h4>
188
+ <div align="center">
189
+ <img width="80" alt="Lesli icon" src="https://cdn.lesli.tech/lesli/brand/app-icon.svg" />
190
+ <h3 align="center">The Open-Source SaaS Development Framework for Ruby on Rails.</h3>
133
191
  </div>
134
-
135
- <br />
metadata CHANGED
@@ -1,13 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lesli_testing
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Lesli Development Team
8
+ autorequire:
8
9
  bindir: exe
9
10
  cert_chain: []
10
- date: 1980-01-02 00:00:00.000000000 Z
11
+ date: 2026-10-13 00:00:00.000000000 Z
11
12
  dependencies:
12
13
  - !ruby/object:Gem::Dependency
13
14
  name: termline
@@ -43,14 +44,14 @@ dependencies:
43
44
  requirements:
44
45
  - - "~>"
45
46
  - !ruby/object:Gem::Version
46
- version: 0.22.0
47
+ version: 1.3.2
47
48
  type: :runtime
48
49
  prerelease: false
49
50
  version_requirements: !ruby/object:Gem::Requirement
50
51
  requirements:
51
52
  - - "~>"
52
53
  - !ruby/object:Gem::Version
53
- version: 0.22.0
54
+ version: 1.3.2
54
55
  - !ruby/object:Gem::Dependency
55
56
  name: simplecov-html
56
57
  requirement: !ruby/object:Gem::Requirement
@@ -85,14 +86,14 @@ dependencies:
85
86
  requirements:
86
87
  - - "~>"
87
88
  - !ruby/object:Gem::Version
88
- version: 3.1.0
89
+ version: 4.0.0
89
90
  type: :runtime
90
91
  prerelease: false
91
92
  version_requirements: !ruby/object:Gem::Requirement
92
93
  requirements:
93
94
  - - "~>"
94
95
  - !ruby/object:Gem::Version
95
- version: 3.1.0
96
+ version: 4.0.0
96
97
  description: "Core testing utilities for the Lesli Platform, providing standardized
97
98
  Minitest configuration, \ncoverage setup, and shared testing conventions across
98
99
  applications, engines and gems.\n"
@@ -123,6 +124,7 @@ metadata:
123
124
  source_code_uri: https://github.com/LesliTech/LesliTesting
124
125
  bug_tracker_uri: https://github.com/LesliTech/LesliTesting/issues
125
126
  documentation_uri: https://www.lesli.dev/gems/testing/
127
+ post_install_message:
126
128
  rdoc_options: []
127
129
  require_paths:
128
130
  - lib
@@ -137,7 +139,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
137
139
  - !ruby/object:Gem::Version
138
140
  version: '0'
139
141
  requirements: []
140
- rubygems_version: 3.7.1
142
+ rubygems_version: 3.5.16
143
+ signing_key:
141
144
  specification_version: 4
142
145
  summary: Shared testing and coverage configuration for the Lesli Platform.
143
146
  test_files: []