minitest-rack 0.2.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: 811e3dd7e9502b380de1de9211f7b9a661d353fc8e93072c3075fb9a4a1ab059
4
+ data.tar.gz: 1853dc9d7db3ed7344cc56ff9fd9060152cbc8afd6728e1fd2b9990a6294a642
5
+ SHA512:
6
+ metadata.gz: a8c2725fab0f829e0329a6427c8cf6aef182cd3e1aa98b2b65ad8616b0b9a1ed273ee32c2e95310f498392af676a6715b4c13d432df4eae91a8b1dcebc6f8ceb
7
+ data.tar.gz: 0e14362d96fbfe2d1231a8cc834bda466c62b693527146d124bc9a05f0a7cac7134a821d4a5c065c16976a547937d3f6c8dbd12e39ef4e05ffb09bf37625572d
@@ -0,0 +1,24 @@
1
+ # To get started with Dependabot version updates, you'll need to specify which
2
+ # package ecosystems to update and where the package manifests are located.
3
+ # Please see the documentation for all configuration options:
4
+ # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5
+
6
+ version: 2
7
+ updates:
8
+ - package-ecosystem: "github-actions"
9
+ directory: "/"
10
+ schedule:
11
+ interval: "weekly"
12
+ day: "saturday"
13
+ time: "21:30"
14
+ timezone: Asia/Kuala_Lumpur
15
+ - package-ecosystem: "bundler" # See documentation for possible values
16
+ directory: "/" # Location of package manifests
17
+ groups:
18
+ patch-and-minor-dependencies:
19
+ update-types: ["patch", "minor"]
20
+ schedule:
21
+ interval: "weekly"
22
+ day: "saturday"
23
+ time: "21:30"
24
+ timezone: Asia/Kuala_Lumpur
@@ -0,0 +1,45 @@
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+
6
+ # GitHub recommends pinning actions to a commit SHA.
7
+ # To get a newer version, you will need to update the SHA.
8
+ # You can also reference a tag or branch, but the action may change without warning.
9
+
10
+ name: Ruby
11
+
12
+ on:
13
+ push:
14
+ branches: ["master", "ruby-v3x"]
15
+ pull_request:
16
+ branches: ["master", "ruby-v3x"]
17
+
18
+ permissions:
19
+ contents: read
20
+
21
+ jobs:
22
+ lint_and_test:
23
+ env:
24
+ RACK_ENV: test
25
+ COVERAGE: "true"
26
+ strategy:
27
+ matrix:
28
+ os: [ubuntu-latest, macos-latest]
29
+ ruby-version: ["3.0", "3.1", "3.2", "3.3"]
30
+ # Disable JRuby for now
31
+ # ruby-version: ["3.0", "3.1", "3.2", "3.3", "jruby-9.4"]
32
+ runs-on: ${{ matrix.os }}
33
+ timeout-minutes: 3
34
+
35
+ steps:
36
+ - uses: actions/checkout@v4
37
+ - name: Set up Ruby
38
+ # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
39
+ # change this to (see https://github.com/ruby/setup-ruby#versioning):
40
+ uses: ruby/setup-ruby@v1
41
+ with:
42
+ ruby-version: ${{ matrix.ruby-version }}
43
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
44
+ - name: Run rake (lint and test)
45
+ run: bundle exec rake
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+ /Gemfile.lock
data/.rubocop.yml ADDED
@@ -0,0 +1,33 @@
1
+ inherit_from: .rubocop_todo.yml
2
+
3
+ require:
4
+ - rubocop-minitest
5
+ - rubocop-performance
6
+ - rubocop-rake
7
+
8
+ # The behavior of RuboCop can be controlled via the .rubocop.yml
9
+ # configuration file. It makes it possible to enable/disable
10
+ # certain cops (checks) and to alter their behavior if they accept
11
+ # any parameters. The file can be placed either in your home
12
+ # directory or in some project directory.
13
+ #
14
+ # RuboCop will start looking for the configuration file in the directory
15
+ # where the inspected file is and continue its way up to the root directory.
16
+ #
17
+ # See https://docs.rubocop.org/rubocop/configuration
18
+
19
+ AllCops:
20
+ TargetRubyVersion: "3.0"
21
+ NewCops: enable
22
+
23
+ Style/StringLiterals:
24
+ EnforcedStyle: single_quotes
25
+
26
+ Style/StringLiteralsInInterpolation:
27
+ EnforcedStyle: double_quotes
28
+
29
+ Layout/LineLength:
30
+ Enabled: true
31
+ Max: 100
32
+ Exclude:
33
+ - "**/*.gemspec"
data/.rubocop_todo.yml ADDED
@@ -0,0 +1,7 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2024-11-11 09:26:46 UTC using RuboCop version 1.68.0.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ - Using welcoming and inclusive language
18
+ - Being respectful of differing viewpoints and experiences
19
+ - Gracefully accepting constructive criticism
20
+ - Focusing on what is best for the community
21
+ - Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ - The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ - Trolling, insulting/derogatory comments, and personal or political attacks
28
+ - Public or private harassment
29
+ - Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ - Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at kematzy@gmail.com. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [http://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: http://contributor-covenant.org
74
+ [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile ADDED
@@ -0,0 +1,83 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ # Specify your gem's dependencies in minitest-assert_errors.gemspec
6
+ gemspec
7
+
8
+ # adding these to silence warnings for Ruby v3.5
9
+ gem 'fiddle'
10
+ gem 'logger'
11
+ gem 'ostruct'
12
+
13
+ group :development do
14
+ # A command line tool to easily handle events on file system modifications
15
+ # DOCS: https://github.com/guard/guard
16
+ gem 'guard'
17
+ # automatically runs your tests with Minitest framework
18
+ # DOCS: https://github.com/guard/guard-minitest
19
+ gem 'guard-minitest'
20
+
21
+ # Ruby testing framework
22
+ # DOCS: https://github.com/seattlerb/minitest
23
+ gem 'minitest', '~> 5.7', '>= 5.7.0'
24
+ # Around and before_all/after_all hooks for Minitest
25
+ # DOCS: https://github.com/jeremyevans/minitest-hooks
26
+ gem 'minitest-hooks', '~> 1.1', '>= 1.1.0'
27
+ # Colored red/green output for Minitest
28
+ # DOCS: https://github.com/blowmage/minitest-rg
29
+ gem 'minitest-rg', '~> 5.3', '>= 5.3.0'
30
+
31
+ # Ruby build program with capabilities similar to Make
32
+ # DOCS: https://github.com/ruby/rake
33
+ gem 'rake', '~> 13.0'
34
+
35
+ # Ruby static code analyzer and formatter
36
+ # DOCS: https://github.com/rubocop/rubocop
37
+ gem 'rubocop', '~> 1.31', require: false
38
+ # Code style checking for Minitest files
39
+ # DOCS: https://github.com/rubocop/rubocop-minitest
40
+ gem 'rubocop-minitest', require: false
41
+ # Performance optimization analysis for your projects
42
+ # DOCS: https://github.com/rubocop/rubocop-performance
43
+ gem 'rubocop-performance', require: false
44
+ # A RuboCop extension focused on enforcing Rake best practices and coding conventions
45
+ # DOCS: https://github.com/rubocop/rubocop-rake
46
+ gem 'rubocop-rake', require: false
47
+
48
+ # Sequel: The Database Toolkit for Ruby
49
+ # DOCS: https://github.com/jeremyevans/sequel/
50
+ gem 'sequel'
51
+ # SQLite3 interface for Ruby
52
+ # DOCS: https://github.com/sparklemotion/sqlite3-ruby
53
+ gem 'sqlite3'
54
+
55
+ # Code coverage for Ruby
56
+ # DOCS: https://github.com/simplecov-ruby/simplecov
57
+ gem 'simplecov'
58
+
59
+ # A Ruby language server that provides intellisense, code completion, and inline documentation
60
+ # DOCS: https://github.com/castwide/solargraph
61
+ gem 'solargraph'
62
+ end
63
+
64
+ # Linux-specific gems
65
+ install_if -> { RUBY_PLATFORM.include?('linux') } do
66
+ # Linux inotify wrapper for Ruby
67
+ # DOCS: https://github.com/guard/rb-inotify
68
+ gem 'rb-inotify', require: false
69
+ end
70
+
71
+ # macOS-specific gems
72
+ install_if -> { RUBY_PLATFORM.include?('darwin') } do
73
+ # FSEvents API with signals handled for macOS
74
+ # DOCS: https://github.com/thibaudgg/rb-fsevent
75
+ gem 'rb-fsevent', require: false
76
+ end
77
+
78
+ # Windows-specific gems
79
+ install_if -> { Gem.win_platform? } do
80
+ # Windows Directory Monitor - A library which can be used to monitor directories for changes
81
+ # DOCS: https://github.com/Maher4Ever/wdm
82
+ gem 'wdm'
83
+ end
data/Guardfile ADDED
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ # A sample Guardfile
4
+ # More info at https://github.com/guard/guard#readme
5
+
6
+ ## Uncomment and set this to only include directories you want to watch
7
+ # directories %w(app lib config test spec features) \
8
+ # .select{|d| Dir.exist?(d) ? d : UI.warning("Directory #{d} does not exist")}
9
+
10
+ ## Note: if you are using the `directories` clause above and you are not
11
+ ## watching the project directory ('.'), then you will want to move
12
+ ## the Guardfile to a watched dir and symlink it back, e.g.
13
+ #
14
+ # $ mkdir config
15
+ # $ mv Guardfile config/
16
+ # $ ln -s config/Guardfile .
17
+ #
18
+ # and, you'll have to watch "config/Guardfile" instead of "Guardfile"
19
+
20
+ guard :minitest do
21
+ # with Minitest::Spec
22
+ watch(%r{^spec/(.*)_spec\.rb$})
23
+ # watch(%r{^lib/minitest/rack/(.+)\.rb$}) { 'spec' }
24
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
25
+ watch(%r{^spec/spec_helper\.rb$}) { 'spec' }
26
+ end
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2018 Kematzy
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 all
13
+ 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 THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,99 @@
1
+ <!-- markdownlint-disable MD013 MD033 -->
2
+
3
+ # Minitest::Rack
4
+
5
+ [![Ruby](https://github.com/kematzy/minitest-rack/actions/workflows/ruby.yml/badge.svg?branch=master)](https://github.com/kematzy/minitest-rack/actions/workflows/ruby.yml) - [![Gem Version](https://badge.fury.io/rb/minitest-rack.svg)](https://badge.fury.io/rb/minitest-rack) - [![Minitest Style Guide](https://img.shields.io/badge/code_style-rubocop-brightgreen.svg)](https://github.com/rubocop/rubocop-minitest)
6
+
7
+ Coverage: **100%**
8
+
9
+ [Minitest](https://github.com/seattlerb/minitest) & [rack-test](https://github.com/rack/rack-test)
10
+ convenience assertions/expectations for DRY'er faster testing.
11
+
12
+ Save time and energy by writing short effecient obvious assertions/expectations with Rack-test
13
+ when using Minitest.
14
+
15
+ ---
16
+
17
+ ## Installation
18
+
19
+ Add this line to your application's Gemfile:
20
+
21
+ ```ruby
22
+ gem 'minitest-rack'
23
+ ```
24
+
25
+ And then execute:
26
+
27
+ ```bash
28
+ bundle
29
+ ```
30
+
31
+ Or install it yourself as:
32
+
33
+ ```bash
34
+ gem install minitest-rack
35
+ ```
36
+
37
+ ## Usage
38
+
39
+ Add the gem to your _Gemfile_ or _.gemspec_ file and then load the gem in your
40
+ `(test|spec)_helper.rb` file as follows:
41
+
42
+ ```ruby
43
+ # <snip...>
44
+
45
+ require 'minitest/autorun'
46
+ require 'minitest/rack'
47
+
48
+ # <snip...>
49
+ ```
50
+
51
+ Adding the above to your `spec_helper.rb` file automatically adds the key helper methods to the
52
+ `Minitest::Assertions` to test for Rack output.
53
+
54
+ ---
55
+
56
+ ## Requirements
57
+
58
+ - [json](https://github.com/flori/json)
59
+ - [rack-test](https://github.com/brynary/rack-test)
60
+ - [minitest](https://github.com/seattlerb/minitest) ~> 5.0
61
+
62
+ ## Acknowledgements
63
+
64
+ Inspiration for this gem was taken from the
65
+ [`rack-minitest`](https://github.com/brandonweiss/rack-minitest) gem by Brandon Weiss
66
+
67
+ Copyright (c) 2012 Brandon Weiss and released under the MIT license.
68
+
69
+ ---
70
+
71
+ ## Development
72
+
73
+ After checking out the repo, run `bundle install` to install dependencies.
74
+ Then, run `bundle exec rake spec` to run the tests.
75
+
76
+ To install this gem onto your local machine, run `bundle exec rake install`.
77
+
78
+ To release a new version:
79
+
80
+ 1. update the version number in `version.rb`
81
+ 2. run `bundle exec rake release`, which will create a git tag for the version
82
+ 3. push git commits and tags
83
+ 4. push the `.gem` file to [rubygems.org](https://rubygems.org).
84
+
85
+ ## Contributing
86
+
87
+ Bug reports and pull requests are welcome on [GitHub](https://github.com/kematzy/minitest-assert_errors).
88
+
89
+ This project is intended to be a safe, welcoming space for collaboration, and contributors are
90
+ expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
91
+
92
+ ## Copyright
93
+
94
+ Copyright (c) 2015 - 2024 Kematzy
95
+
96
+ ## License
97
+
98
+ The gem is available as open source under the terms of the
99
+ [MIT License](http://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler/gem_tasks'
4
+ require 'rubocop/rake_task'
5
+ require 'rake/testtask'
6
+
7
+ RuboCop::RakeTask.new
8
+
9
+ Rake::TestTask.new(:spec) do |t|
10
+ t.libs << 'spec'
11
+ t.libs << 'lib'
12
+ t.test_files = FileList['spec/**/*_spec.rb']
13
+ end
14
+
15
+ task default: %i[rubocop coverage]
16
+
17
+ desc 'alias for spec task'
18
+ task test: :spec
19
+
20
+ desc 'Run specs with coverage'
21
+ task :coverage do
22
+ ENV['COVERAGE'] = '1'
23
+ Rake::Task['spec'].invoke
24
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'rack/test'
4
+ require 'minitest/rack'
5
+ require 'minitest/rack/headers'
6
+ require 'minitest/rack/json'
7
+ require 'minitest/rack/status'