doctest2-rspec 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: ea7b8c8551ff4d3b9861598da5366b2690f99908de130963b26f33c888013e4f
4
+ data.tar.gz: 48e512579f8c26c236ef67676dc42e420423e39c3d00698995c20d88ef610c3b
5
+ SHA512:
6
+ metadata.gz: 7282f3867fb21ad7d793975805c507fd047a46b3f34ca8b2b4f01f93f32d88cbf6dc32d3d4b6b9af622358c04c3793190a074012899d1bd7a89b707660710227
7
+ data.tar.gz: 7baa68dbc7c58bf486c75dade867f5c7ce4cfb4c3e911ac312c91076436fea297966c720263f53ad5734aaa304f902519a5a0a25b86aea573251b9d63b8cb195
data/.rubocop.yml ADDED
@@ -0,0 +1,13 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.6
3
+
4
+ Style/StringLiterals:
5
+ Enabled: true
6
+ EnforcedStyle: double_quotes
7
+
8
+ Style/StringLiteralsInInterpolation:
9
+ Enabled: true
10
+ EnforcedStyle: double_quotes
11
+
12
+ Layout/LineLength:
13
+ Max: 120
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
@@ -0,0 +1,16 @@
1
+ setup_and_test: setup test
2
+
3
+ setup:
4
+ bin/setup
5
+
6
+ test:
7
+ bundle exec rake test
8
+
9
+ console:
10
+ bin/console
11
+
12
+ install:
13
+ bundle exec rake install
14
+
15
+ release:
16
+ bundle exec rake release
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
@@ -0,0 +1,4 @@
1
+ # Doctest2::Minitest
2
+
3
+ Read the main README at [../README.md](../README.md)
4
+
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,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Doctest2
4
+ module Minitest
5
+ VERSION = "0.9.0"
6
+ end
7
+ end
@@ -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
@@ -0,0 +1,6 @@
1
+ module Doctest2
2
+ module Minitest
3
+ VERSION: String
4
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
5
+ end
6
+ end
metadata ADDED
@@ -0,0 +1,85 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: doctest2-rspec
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: []