lesli_testing 0.1.0 → 1.0.0
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 -1
- data/lib/lesli_testing/loader.rb +79 -0
- data/lib/lesli_testing/testers.rb +60 -0
- data/lib/lesli_testing/version.rb +2 -1
- data/lib/lesli_testing.rb +0 -61
- metadata +3 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ae4f59e22ab09f30f13faa767593783ca16de6d3e525b2e9bb960a13568231a3
|
|
4
|
+
data.tar.gz: 0c21db2bc448502669c3bddd9f5d2fdac44c66063633072c02657cff8a1bc612
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c6b38d973118dfd0d6b2d5d0ed9a728ec6fdf638e84e561edd06b2be148d846279869f8dca9f18d79e6770ccace4eb9f8f002ddb0e688e13f116215c6e90ef18
|
|
7
|
+
data.tar.gz: 94bcdfce3324ebae8be4d332e1729ac4616f653044dd4e32a13f46189c890aa4c6e398d147071593e3808fced220c6cab0ea09ea213d359eced03532f5b30cda
|
data/lib/lesli_testing/config.rb
CHANGED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Lesli
|
|
4
|
+
#
|
|
5
|
+
# Copyright (c) 2025, 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
|
+
|
|
32
|
+
|
|
33
|
+
# Load code coverage tools
|
|
34
|
+
require "simplecov"
|
|
35
|
+
require "simplecov-console"
|
|
36
|
+
require "simplecov-cobertura"
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
# Load test frameworks
|
|
40
|
+
require "minitest/reporters"
|
|
41
|
+
require "color_pound_spec_reporter"
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
# Load test configuration and test helper modules
|
|
45
|
+
require_relative "config"
|
|
46
|
+
require_relative "coverage"
|
|
47
|
+
require_relative "testers"
|
|
48
|
+
|
|
49
|
+
module LesliTesting
|
|
50
|
+
class Error < StandardError; end
|
|
51
|
+
|
|
52
|
+
class << self
|
|
53
|
+
|
|
54
|
+
def load(engine_module = nil, options = {})
|
|
55
|
+
|
|
56
|
+
name = engine_module ? engine_module.name : "RailsApp"
|
|
57
|
+
|
|
58
|
+
# 1. Notify
|
|
59
|
+
show_welcome_message
|
|
60
|
+
|
|
61
|
+
# 2. Start Coverage
|
|
62
|
+
LesliTesting::Coverage.start(name, options[:min_coverage] || 40)
|
|
63
|
+
|
|
64
|
+
# 3. Apply Minitest/Reporters/Paths
|
|
65
|
+
LesliTesting::Config.apply(engine_module)
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
private
|
|
69
|
+
|
|
70
|
+
def show_welcome_message
|
|
71
|
+
L2.info(
|
|
72
|
+
"Running Lesli tests...",
|
|
73
|
+
"For a better result run test over a clean database",
|
|
74
|
+
"You can use: rake dev:db:reset")
|
|
75
|
+
|
|
76
|
+
L2.br
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
end
|
|
@@ -0,0 +1,60 @@
|
|
|
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
|
+
|
|
34
|
+
#
|
|
35
|
+
require_relative "helpers/response_integration_helper"
|
|
36
|
+
|
|
37
|
+
#
|
|
38
|
+
module LesliTesting
|
|
39
|
+
|
|
40
|
+
class IntegrationTester < ActionDispatch::IntegrationTest
|
|
41
|
+
include ResponseIntegrationHelper
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
class ViewTester < ActionView::TestCase
|
|
45
|
+
# We use a hook to include the helpers only when the class is used.
|
|
46
|
+
# This ensures Lesli core is fully loaded by Rails before we ask for the helpers.
|
|
47
|
+
def self.inherited(subclass)
|
|
48
|
+
super
|
|
49
|
+
subclass.class_eval do
|
|
50
|
+
include Lesli::HtmlHelper if defined?(Lesli::HtmlHelper)
|
|
51
|
+
include Lesli::SystemHelper if defined?(Lesli::SystemHelper)
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Define the base classes inside the namespace
|
|
57
|
+
class ModelTester < ActiveSupport::TestCase
|
|
58
|
+
include ActiveSupport::Testing::TimeHelpers
|
|
59
|
+
end
|
|
60
|
+
end
|
data/lib/lesli_testing.rb
CHANGED
|
@@ -32,66 +32,5 @@
|
|
|
32
32
|
#
|
|
33
33
|
require_relative "lesli_testing/version"
|
|
34
34
|
|
|
35
|
-
# Load test frameworks
|
|
36
|
-
require "minitest/reporters"
|
|
37
|
-
require "color_pound_spec_reporter"
|
|
38
|
-
require "propshaft"
|
|
39
|
-
|
|
40
|
-
# Load code coverage tools
|
|
41
|
-
require "simplecov"
|
|
42
|
-
require "simplecov-console"
|
|
43
|
-
require "simplecov-cobertura"
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
# Load test configuration and test helper modules
|
|
47
|
-
require_relative "lesli_testing/config"
|
|
48
|
-
require_relative "lesli_testing/coverage"
|
|
49
|
-
require_relative "lesli_testing/helpers/response_integration_helper"
|
|
50
|
-
|
|
51
35
|
module LesliTesting
|
|
52
|
-
class Error < StandardError; end
|
|
53
|
-
|
|
54
|
-
class IntegrationTester < ActionDispatch::IntegrationTest
|
|
55
|
-
include ResponseIntegrationHelper
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
class ViewTester < ActionView::TestCase
|
|
59
|
-
# We use a hook to include the helpers only when the class is used.
|
|
60
|
-
# This ensures Lesli core is fully loaded by Rails before we ask for the helpers.
|
|
61
|
-
def self.inherited(subclass)
|
|
62
|
-
super
|
|
63
|
-
subclass.class_eval do
|
|
64
|
-
include Lesli::HtmlHelper if defined?(Lesli::HtmlHelper)
|
|
65
|
-
include Lesli::SystemHelper if defined?(Lesli::SystemHelper)
|
|
66
|
-
end
|
|
67
|
-
end
|
|
68
|
-
end
|
|
69
|
-
|
|
70
|
-
# Define the base classes inside the namespace
|
|
71
|
-
class ModelTester < ActiveSupport::TestCase
|
|
72
|
-
include ActiveSupport::Testing::TimeHelpers
|
|
73
|
-
end
|
|
74
|
-
|
|
75
|
-
class << self
|
|
76
|
-
|
|
77
|
-
def init(engine_module = nil, options = {})
|
|
78
|
-
# 1. Start Coverage
|
|
79
|
-
name = engine_module ? engine_module.name : "RailsApp"
|
|
80
|
-
LesliTesting::Coverage.start(name, options[:min_coverage] || 40)
|
|
81
|
-
|
|
82
|
-
# 2. Apply Minitest/Reporters/Paths
|
|
83
|
-
LesliTesting::Config.apply(engine_module)
|
|
84
|
-
|
|
85
|
-
# 4. Notify
|
|
86
|
-
show_welcome_message
|
|
87
|
-
end
|
|
88
|
-
|
|
89
|
-
private
|
|
90
|
-
|
|
91
|
-
def show_welcome_message
|
|
92
|
-
puts "\n\e[34mRunning Lesli tests...\e[0m"
|
|
93
|
-
puts "For a better result run test over a clean database"
|
|
94
|
-
puts "You can use: \e[33mrake dev:db:reset test\e[0m\n\n"
|
|
95
|
-
end
|
|
96
|
-
end
|
|
97
36
|
end
|
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:
|
|
4
|
+
version: 1.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- The Lesli Development Team
|
|
@@ -152,6 +152,8 @@ files:
|
|
|
152
152
|
- lib/lesli_testing/config.rb
|
|
153
153
|
- lib/lesli_testing/coverage.rb
|
|
154
154
|
- lib/lesli_testing/helpers/response_integration_helper.rb
|
|
155
|
+
- lib/lesli_testing/loader.rb
|
|
156
|
+
- lib/lesli_testing/testers.rb
|
|
155
157
|
- lib/lesli_testing/version.rb
|
|
156
158
|
- license
|
|
157
159
|
- readme.md
|