doctest2-minitest 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.rubocop.yml +13 -0
- data/.tool-versions +1 -0
- data/Gemfile +13 -0
- data/Gemfile.lock +51 -0
- data/Justfile +16 -0
- data/LICENSE.txt +21 -0
- data/README.md +4 -0
- data/Rakefile +16 -0
- data/lib/doctest2/minitest/version.rb +7 -0
- data/lib/doctest2/minitest.rb +39 -0
- data/sig/doctest2/minitest.rbs +6 -0
- metadata +85 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 50ce06db708a322951286cb982bae62a608b34d014f84e10400b6b10b00c0012
|
4
|
+
data.tar.gz: e3b964a1b73c8a7c49d639d59dec5bf72558a70cf155501130d24af9193ab031
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: da4ad829171bccf841eed78269f8f1988dfd250a9594a3621e0b11008a002aeb909effba1b3828499d601ef87722e473c67e5ed221d1d281e954c3288d279300
|
7
|
+
data.tar.gz: ac58e3dfcfd1d79474e12accde7a73fc4f7547c39d8e644844c17e4f23d58498406f0a98469f05fe05161359788e25b4249b1f821ebbbe32cf64aed28a82ca98
|
data/.rubocop.yml
ADDED
data/.tool-versions
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby 3.2.2
|
data/Gemfile
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
source "https://rubygems.org"
|
4
|
+
|
5
|
+
# Specify your gem's dependencies in doctest2-minitest.gemspec
|
6
|
+
gemspec
|
7
|
+
|
8
|
+
gem "rake", "~> 13.0"
|
9
|
+
|
10
|
+
gem "rubocop", "~> 1.21"
|
11
|
+
|
12
|
+
# for temporary easy local development
|
13
|
+
# gem 'doctest2-core', path: "../doctest2-core"
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ../doctest2-core
|
3
|
+
specs:
|
4
|
+
doctest2-core (0.1.0)
|
5
|
+
|
6
|
+
PATH
|
7
|
+
remote: .
|
8
|
+
specs:
|
9
|
+
doctest2-rspec (0.1.0)
|
10
|
+
doctest2-core (~> 0.1.0)
|
11
|
+
minitest (~> 5.0)
|
12
|
+
|
13
|
+
GEM
|
14
|
+
remote: https://rubygems.org/
|
15
|
+
specs:
|
16
|
+
ast (2.4.2)
|
17
|
+
json (2.6.3)
|
18
|
+
minitest (5.18.0)
|
19
|
+
parallel (1.23.0)
|
20
|
+
parser (3.2.2.1)
|
21
|
+
ast (~> 2.4.1)
|
22
|
+
rainbow (3.1.1)
|
23
|
+
rake (13.0.6)
|
24
|
+
regexp_parser (2.8.0)
|
25
|
+
rexml (3.2.5)
|
26
|
+
rubocop (1.50.2)
|
27
|
+
json (~> 2.3)
|
28
|
+
parallel (~> 1.10)
|
29
|
+
parser (>= 3.2.0.0)
|
30
|
+
rainbow (>= 2.2.2, < 4.0)
|
31
|
+
regexp_parser (>= 1.8, < 3.0)
|
32
|
+
rexml (>= 3.2.5, < 4.0)
|
33
|
+
rubocop-ast (>= 1.28.0, < 2.0)
|
34
|
+
ruby-progressbar (~> 1.7)
|
35
|
+
unicode-display_width (>= 2.4.0, < 3.0)
|
36
|
+
rubocop-ast (1.28.1)
|
37
|
+
parser (>= 3.2.1.0)
|
38
|
+
ruby-progressbar (1.13.0)
|
39
|
+
unicode-display_width (2.4.2)
|
40
|
+
|
41
|
+
PLATFORMS
|
42
|
+
arm64-darwin-22
|
43
|
+
|
44
|
+
DEPENDENCIES
|
45
|
+
doctest2-core!
|
46
|
+
doctest2-rspec!
|
47
|
+
rake (~> 13.0)
|
48
|
+
rubocop (~> 1.21)
|
49
|
+
|
50
|
+
BUNDLED WITH
|
51
|
+
2.4.10
|
data/Justfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2023 qqwy
|
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
data/Rakefile
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "bundler/gem_tasks"
|
4
|
+
require "rake/testtask"
|
5
|
+
|
6
|
+
Rake::TestTask.new(:test) do |t|
|
7
|
+
t.libs << "test"
|
8
|
+
t.libs << "lib"
|
9
|
+
t.test_files = FileList["test/**/test_*.rb"]
|
10
|
+
end
|
11
|
+
|
12
|
+
require "rubocop/rake_task"
|
13
|
+
|
14
|
+
RuboCop::RakeTask.new
|
15
|
+
|
16
|
+
task default: %i[test rubocop]
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'pathname'
|
4
|
+
require_relative "minitest/version"
|
5
|
+
|
6
|
+
module Doctest2
|
7
|
+
module Minitest
|
8
|
+
module DoctestHelpers
|
9
|
+
def self.included(base)
|
10
|
+
base.extend(ClassMethods)
|
11
|
+
end
|
12
|
+
|
13
|
+
module ClassMethods
|
14
|
+
##
|
15
|
+
# To be used inside the body of a tests-class
|
16
|
+
# It will automatically create test cases for all
|
17
|
+
# 'documentation test' snippets that exist in the comments
|
18
|
+
# above the methods in `klass`.
|
19
|
+
def doctest(klass)
|
20
|
+
doctests = Doctest2::Core.extract_from(klass)
|
21
|
+
return puts "Note: Attempting to extract doctests for #{klass}, but none were found (at: #{caller_locations.first})" if doctests.empty?
|
22
|
+
|
23
|
+
doctests.each do |doctest|
|
24
|
+
file_location = Pathname.new(doctest.original_file).relative_path_from(Pathname.pwd)
|
25
|
+
define_method("test_ (doctest) #{file_location}:#{doctest.line}") do
|
26
|
+
message = "While running doctest: \n\t#{doctest.code_string}\n"
|
27
|
+
begin
|
28
|
+
assert_equal(doctest.result_evaluation, doctest.code_evaluation, message)
|
29
|
+
rescue StandardError => error
|
30
|
+
error.message << "\n\n#{message}"
|
31
|
+
raise error
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
metadata
ADDED
@@ -0,0 +1,85 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: doctest2-minitest
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.9.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Qqwy/Marten
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2023-05-12 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: doctest2-core
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.1.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.1.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: minitest
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '5.0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '5.0'
|
41
|
+
description: Integrates documentation tests with Minitest.
|
42
|
+
email:
|
43
|
+
- qqwy@gmx.com
|
44
|
+
executables: []
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- ".rubocop.yml"
|
49
|
+
- ".tool-versions"
|
50
|
+
- Gemfile
|
51
|
+
- Gemfile.lock
|
52
|
+
- Justfile
|
53
|
+
- LICENSE.txt
|
54
|
+
- README.md
|
55
|
+
- Rakefile
|
56
|
+
- lib/doctest2/minitest.rb
|
57
|
+
- lib/doctest2/minitest/version.rb
|
58
|
+
- sig/doctest2/minitest.rbs
|
59
|
+
homepage: https://github.com/Qqwy/ruby-doctest2
|
60
|
+
licenses:
|
61
|
+
- MIT
|
62
|
+
metadata:
|
63
|
+
homepage_uri: https://github.com/Qqwy/ruby-doctest2
|
64
|
+
source_code_uri: https://github.com/Qqwy/ruby-doctest2
|
65
|
+
changelog_uri: https://github.com/Qqwy/ruby-doctest2/blob/main/CHANGELOG.md
|
66
|
+
post_install_message:
|
67
|
+
rdoc_options: []
|
68
|
+
require_paths:
|
69
|
+
- lib
|
70
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: 2.6.0
|
75
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
76
|
+
requirements:
|
77
|
+
- - ">="
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: '0'
|
80
|
+
requirements: []
|
81
|
+
rubygems_version: 3.4.10
|
82
|
+
signing_key:
|
83
|
+
specification_version: 4
|
84
|
+
summary: Run doctests in your Minitest test suite
|
85
|
+
test_files: []
|