lesli_testing 1.2.1 → 1.2.2
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 +4 -4
- data/lib/lesli_testing/config.rb +0 -4
- data/lib/lesli_testing/coverage.rb +1 -1
- data/lib/lesli_testing/engine.rb +67 -0
- data/lib/lesli_testing/loader.rb +1 -1
- data/lib/lesli_testing/reporters/cli_reporter.rb +15 -6
- data/lib/lesli_testing/version.rb +2 -2
- data/lib/lesli_testing.rb +1 -0
- metadata +16 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 582a2365a947f562ffdbd75bfe09f5af077bb1309b12cd9adeb29c8886d13472
|
|
4
|
+
data.tar.gz: a73846f568ac913e621716a49273000631fbbb9255e40e74e59db3f49b2cd41c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9ddde3d544c159212ddcaf4aae80e9f0cd1294165cae78de2dacda04a7a667bf208479a64c38b6d65c4872cdf5229935bfacc3bdd80b4db0dc1be9a66a7f9aed
|
|
7
|
+
data.tar.gz: a035d7f5b72ab485137995eeb8c70102c4ac5e2dd1220a590c40f9bd4732dcdbaadce35bc89f3689f7d103816078570cd053479c99dcb27c466e6e4dc209f920
|
data/lib/lesli_testing/config.rb
CHANGED
|
@@ -38,10 +38,6 @@ module LesliTesting
|
|
|
38
38
|
# Run tests across all the engines: LESLI_INTEGRATION_TEST=true rails test
|
|
39
39
|
# Run tests for the current engine: rails test
|
|
40
40
|
if engine_module
|
|
41
|
-
# Migration and Fixture logic goes here...
|
|
42
|
-
ActiveRecord::Migrator.migrations_paths = [engine_module.root.join("db/migrate").to_s] if defined?(ActiveRecord)
|
|
43
|
-
ActiveRecord::Migrator.migrations_paths = [engine_module.root.join("db/migrate/1.0").to_s] if defined?(ActiveRecord)
|
|
44
|
-
|
|
45
41
|
|
|
46
42
|
# Load fixtures from the engine
|
|
47
43
|
if ActiveSupport::TestCase.respond_to?(:fixture_paths=)
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
|
|
3
|
+
Lesli
|
|
4
|
+
|
|
5
|
+
Copyright (c) 2026, Lesli Technologies, S. A.
|
|
6
|
+
|
|
7
|
+
This program is free software: you can redistribute it and/or modify
|
|
8
|
+
it under the terms of the GNU General Public License as published by
|
|
9
|
+
the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
(at your option) any later version.
|
|
11
|
+
|
|
12
|
+
This program is distributed in the hope that it will be useful,
|
|
13
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
GNU General Public License for more details.
|
|
16
|
+
|
|
17
|
+
You should have received a copy of the GNU General Public License
|
|
18
|
+
along with this program. If not, see http://www.gnu.org/licenses/.
|
|
19
|
+
|
|
20
|
+
Lesli · Ruby on Rails SaaS Development Framework.
|
|
21
|
+
|
|
22
|
+
Made with ♥ by LesliTech
|
|
23
|
+
Building a better future, one line of code at a time.
|
|
24
|
+
|
|
25
|
+
@contact hello@lesli.tech
|
|
26
|
+
@website https://www.lesli.tech
|
|
27
|
+
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
|
28
|
+
|
|
29
|
+
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
|
30
|
+
// ·
|
|
31
|
+
=end
|
|
32
|
+
|
|
33
|
+
module LesliTesting
|
|
34
|
+
class Engine < ::Rails::Engine
|
|
35
|
+
initializer "lesli_testing.load_required_migrations", after: :load_config_initializers do |app|
|
|
36
|
+
|
|
37
|
+
# Only run this if we are in the test environment
|
|
38
|
+
unless Rails.env.production?
|
|
39
|
+
|
|
40
|
+
# 1. Define the dependencies you want to automatically include
|
|
41
|
+
# You can add more gems to this list as your ecosystem grows
|
|
42
|
+
dependencies = ["Lesli"]
|
|
43
|
+
|
|
44
|
+
dependencies.each do |gem_name|
|
|
45
|
+
begin
|
|
46
|
+
# Find the constant for the gem's Engine
|
|
47
|
+
gem_engine = "#{gem_name}::Engine".safe_constantize
|
|
48
|
+
|
|
49
|
+
if gem_engine
|
|
50
|
+
migration_path = gem_engine.root.join("db/migrate").to_s
|
|
51
|
+
|
|
52
|
+
# Append to the main app's migration paths if the directory exists
|
|
53
|
+
if Dir.exist?(migration_path)
|
|
54
|
+
app.config.paths["db/migrate"] << migration_path
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
rescue StandardError => e
|
|
58
|
+
puts "LesliTesting: Could not load migrations for #{gem_name}: #{e.message}"
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# 2. Clean up duplicates
|
|
63
|
+
app.config.paths["db/migrate"].uniq!
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
end
|
data/lib/lesli_testing/loader.rb
CHANGED
|
@@ -37,8 +37,8 @@ require "simplecov-cobertura"
|
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
# Load test frameworks
|
|
40
|
-
require_relative "reporters/cli_reporter"
|
|
41
40
|
require "minitest/lesli_testing_plugin"
|
|
41
|
+
require_relative "reporters/cli_reporter"
|
|
42
42
|
|
|
43
43
|
# Force Minitest to know about Lesli Minitest reporter plugin
|
|
44
44
|
unless Minitest.extensions.include?("lesli_testing")
|
|
@@ -104,22 +104,31 @@ module LesliTesting
|
|
|
104
104
|
failure_tag = failure.is_a?(Minitest::Assertion) ? "FAILURE" : "ERROR"
|
|
105
105
|
failure_msg = "#{result.class}##{result.name} (#{result.assertions} asserts)"
|
|
106
106
|
|
|
107
|
+
location_file = "#{result.source_location.first} (line: #{result.source_location.second})"
|
|
108
|
+
|
|
107
109
|
Termline.br
|
|
108
110
|
Termline.line(6)
|
|
109
111
|
Termline.br
|
|
110
112
|
|
|
113
|
+
puts Termline::Msg.builder(failure_msg, tag: " #{Termline::Style.icon(:error)} #{failure_tag} #{index + 1}:", color: :red, timestamp:nil)
|
|
114
|
+
puts Termline::Msg.builder(location_file, tag: " #{Termline::Style.icon(:debug)} Location:", color: :yellow, timestamp:nil)
|
|
115
|
+
|
|
111
116
|
if failure.is_a?(Minitest::Assertion)
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
puts " #{Termline::Style.colorize(result.failure.message.to_s.lines.second.strip, :red)}"
|
|
116
|
-
else
|
|
117
|
-
Termline.warning(failure_msg, tag: failure_tag)
|
|
117
|
+
result.failure.message.to_s.lines.each do |message|
|
|
118
|
+
puts(parse_minitest_assertion_messages(message))
|
|
119
|
+
end
|
|
118
120
|
end
|
|
119
121
|
end
|
|
120
122
|
|
|
121
123
|
Termline.br
|
|
122
124
|
end
|
|
125
|
+
|
|
126
|
+
def parse_minitest_assertion_messages message
|
|
127
|
+
msg = message.strip
|
|
128
|
+
return Termline::Style.colorize(" + #{msg}", :green) if msg.start_with? "Expected:"
|
|
129
|
+
return Termline::Style.colorize(" - #{msg}", :red) if msg.start_with? "Actual:"
|
|
130
|
+
return Termline::Style.colorize(" #{Termline::Style.icon(:warning)} #{msg}", :yellow)
|
|
131
|
+
end
|
|
123
132
|
end
|
|
124
133
|
end
|
|
125
134
|
end
|
data/lib/lesli_testing.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: lesli_testing
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.2.
|
|
4
|
+
version: 1.2.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- The Lesli Development Team
|
|
@@ -93,6 +93,20 @@ dependencies:
|
|
|
93
93
|
- - "~>"
|
|
94
94
|
- !ruby/object:Gem::Version
|
|
95
95
|
version: 1.10.0
|
|
96
|
+
- !ruby/object:Gem::Dependency
|
|
97
|
+
name: termline
|
|
98
|
+
requirement: !ruby/object:Gem::Requirement
|
|
99
|
+
requirements:
|
|
100
|
+
- - "~>"
|
|
101
|
+
- !ruby/object:Gem::Version
|
|
102
|
+
version: 1.1.0
|
|
103
|
+
type: :runtime
|
|
104
|
+
prerelease: false
|
|
105
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
106
|
+
requirements:
|
|
107
|
+
- - "~>"
|
|
108
|
+
- !ruby/object:Gem::Version
|
|
109
|
+
version: 1.1.0
|
|
96
110
|
description: "Core testing utilities for the Lesli Platform, providing standardized
|
|
97
111
|
Minitest configuration, \ncoverage setup, and shared testing conventions across
|
|
98
112
|
engines and applications.\n"
|
|
@@ -105,6 +119,7 @@ files:
|
|
|
105
119
|
- lib/lesli_testing.rb
|
|
106
120
|
- lib/lesli_testing/config.rb
|
|
107
121
|
- lib/lesli_testing/coverage.rb
|
|
122
|
+
- lib/lesli_testing/engine.rb
|
|
108
123
|
- lib/lesli_testing/helpers/response_integration_helper.rb
|
|
109
124
|
- lib/lesli_testing/loader.rb
|
|
110
125
|
- lib/lesli_testing/reporters/cli_reporter.rb
|