From 048847a312a4f35c8d1e2b23b2bd184e6207cf13 Mon Sep 17 00:00:00 2001 From: Robin Goos <1166835+Goos@users.noreply.github.com> Date: Sun, 4 Jun 2023 19:39:25 -0700 Subject: [PATCH 1/4] Copy over rspec context to reactor thread. (#22) --- lib/async/rspec/reactor.rb | 2 ++ spec/async/rspec/reactor_spec.rb | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/lib/async/rspec/reactor.rb b/lib/async/rspec/reactor.rb index d78ff4a..0c5cba3 100644 --- a/lib/async/rspec/reactor.rb +++ b/lib/async/rspec/reactor.rb @@ -78,6 +78,7 @@ def run_in_reactor(reactor, duration = nil) include Reactor let(:reactor) {@reactor} + rspec_context = Thread.current[:__rspec] include_context Async::RSpec::Leaks around(:each) do |example| @@ -90,6 +91,7 @@ def run_in_reactor(reactor, duration = nil) task.annotate(self.class) run_in_reactor(@reactor, duration) do + Thread.current[:__rspec] = rspec_context example.run end ensure diff --git a/spec/async/rspec/reactor_spec.rb b/spec/async/rspec/reactor_spec.rb index 7529218..1a6558a 100644 --- a/spec/async/rspec/reactor_spec.rb +++ b/spec/async/rspec/reactor_spec.rb @@ -82,4 +82,13 @@ # end.to raise_error("Boom!") # end end + + context "rspec metadata", timeout: 1 do + include_context Async::RSpec::Reactor + + it "should have access to example metadata" do + expect(RSpec.current_example).not_to be_nil + expect(RSpec.current_example.metadata[:described_class]).to eq(Async::RSpec::Reactor) + end + end end From f13a3c32bc2ede5f6beafb729183ba7a772af3e4 Mon Sep 17 00:00:00 2001 From: Samuel Williams Date: Mon, 5 Jun 2023 12:17:25 +0900 Subject: [PATCH 2/4] Modernize gem. (#20) * Remove profiling support - it segfaults on Ruby head. --- .../workflows/{async-v1.yml => async-v1.yaml} | 7 ++- .../{async-head.yml => async-v2.yaml} | 7 ++- .github/workflows/coverage.yaml | 57 +++++++++++++++++ .github/workflows/documentation.yaml | 61 +++++++++++++++++++ .github/workflows/documentation.yml | 32 ---------- .../workflows/{development.yml => test.yaml} | 21 ++++--- .gitignore | 15 ++--- async-rspec.gemspec | 8 ++- gems.rb | 11 +++- gems/async-head.rb | 7 --- gems/async-v1.rb | 3 + gems/async-v2.rb | 10 +++ lib/async/rspec.rb | 23 ++----- lib/async/rspec/buffer.rb | 23 ++----- lib/async/rspec/leaks.rb | 23 ++----- lib/async/rspec/memory.rb | 24 ++------ lib/async/rspec/profile.rb | 50 +++------------ lib/async/rspec/reactor.rb | 4 +- lib/async/rspec/ssl.rb | 23 ++----- lib/async/rspec/version.rb | 23 ++----- license.md | 26 ++++++++ README.md => readme.md | 36 +++-------- release.cert | 28 +++++++++ spec/async/rspec/buffer_spec.rb | 23 ++----- spec/async/rspec/leaks_spec.rb | 23 ++----- spec/async/rspec/memory_spec.rb | 24 ++------ spec/async/rspec/profile_spec.rb | 23 ++----- spec/async/rspec/reactor_spec.rb | 24 ++------ spec/async/rspec/ssl_spec.rb | 23 ++----- spec/spec_helper.rb | 4 ++ 30 files changed, 300 insertions(+), 366 deletions(-) rename .github/workflows/{async-v1.yml => async-v1.yaml} (84%) rename .github/workflows/{async-head.yml => async-v2.yaml} (82%) create mode 100644 .github/workflows/coverage.yaml create mode 100644 .github/workflows/documentation.yaml delete mode 100644 .github/workflows/documentation.yml rename .github/workflows/{development.yml => test.yaml} (72%) delete mode 100644 gems/async-head.rb create mode 100644 gems/async-v2.rb create mode 100644 license.md rename README.md => readme.md (61%) create mode 100644 release.cert diff --git a/.github/workflows/async-v1.yml b/.github/workflows/async-v1.yaml similarity index 84% rename from .github/workflows/async-v1.yml rename to .github/workflows/async-v1.yaml index e013d50..df8d41d 100644 --- a/.github/workflows/async-v1.yml +++ b/.github/workflows/async-v1.yaml @@ -12,8 +12,11 @@ jobs: - ubuntu ruby: - - 2.7 - + - "2.7" + - "3.0" + - "3.1" + - "3.2" + env: BUNDLE_GEMFILE: gems/async-v1.rb diff --git a/.github/workflows/async-head.yml b/.github/workflows/async-v2.yaml similarity index 82% rename from .github/workflows/async-head.yml rename to .github/workflows/async-v2.yaml index 8b8541a..ae70fe2 100644 --- a/.github/workflows/async-head.yml +++ b/.github/workflows/async-v2.yaml @@ -1,4 +1,4 @@ -name: Async head +name: Async v2 on: [push, pull_request] @@ -12,10 +12,11 @@ jobs: - ubuntu ruby: - - head + - "3.1" + - "3.2" env: - BUNDLE_GEMFILE: gems/async-head.rb + BUNDLE_GEMFILE: gems/async-v2.rb steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml new file mode 100644 index 0000000..81f3c65 --- /dev/null +++ b/.github/workflows/coverage.yaml @@ -0,0 +1,57 @@ +name: Coverage + +on: [push, pull_request] + +permissions: + contents: read + +env: + CONSOLE_OUTPUT: XTerm + COVERAGE: PartialSummary + +jobs: + test: + name: ${{matrix.ruby}} on ${{matrix.os}} + runs-on: ${{matrix.os}}-latest + + strategy: + matrix: + os: + - ubuntu + - macos + + ruby: + - "3.2" + + steps: + - uses: actions/checkout@v3 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{matrix.ruby}} + bundler-cache: true + + - name: Run tests + timeout-minutes: 5 + run: bundle exec bake test + + - uses: actions/upload-artifact@v2 + with: + name: coverage-${{matrix.os}}-${{matrix.ruby}} + path: .covered.db + + validate: + needs: test + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.2" + bundler-cache: true + + - uses: actions/download-artifact@v3 + + - name: Validate coverage + timeout-minutes: 5 + run: bundle exec bake covered:validate --paths */.covered.db \; diff --git a/.github/workflows/documentation.yaml b/.github/workflows/documentation.yaml new file mode 100644 index 0000000..3d483fc --- /dev/null +++ b/.github/workflows/documentation.yaml @@ -0,0 +1,61 @@ +name: Documentation + +on: + push: + branches: + - main + + # Allows you to run this workflow manually from the Actions tab: + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages: +permissions: + contents: read + pages: write + id-token: write + +# Allow one concurrent deployment: +concurrency: + group: "pages" + cancel-in-progress: true + +env: + CONSOLE_OUTPUT: XTerm + BUNDLE_WITH: maintenance + +jobs: + generate: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.2" + bundler-cache: true + + - name: Installing packages + run: sudo apt-get install wget + + - name: Generate documentation + timeout-minutes: 5 + run: bundle exec bake utopia:project:static --force no + + - name: Upload documentation artifact + uses: actions/upload-pages-artifact@v1 + with: + path: docs + + deploy: + runs-on: ubuntu-latest + + environment: + name: github-pages + url: ${{steps.deployment.outputs.page_url}} + + needs: generate + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v1 diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml deleted file mode 100644 index 4a4a663..0000000 --- a/.github/workflows/documentation.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Documentation - -on: - push: - branches: - - master - -jobs: - deploy: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - uses: ruby/setup-ruby@v1 - env: - BUNDLE_WITH: maintenance - with: - ruby-version: 2.7 - bundler-cache: true - - - name: Installing packages - run: sudo apt-get install wget - - - name: Generate documentation - timeout-minutes: 5 - run: bundle exec bake utopia:project:static - - - name: Deploy documentation - uses: JamesIves/github-pages-deploy-action@4.0.0 - with: - branch: docs - folder: docs diff --git a/.github/workflows/development.yml b/.github/workflows/test.yaml similarity index 72% rename from .github/workflows/development.yml rename to .github/workflows/test.yaml index 60f92bd..5c765b6 100644 --- a/.github/workflows/development.yml +++ b/.github/workflows/test.yaml @@ -1,9 +1,16 @@ -name: Development +name: Test on: [push, pull_request] +permissions: + contents: read + +env: + CONSOLE_OUTPUT: XTerm + jobs: test: + name: ${{matrix.ruby}} on ${{matrix.os}} runs-on: ${{matrix.os}}-latest continue-on-error: ${{matrix.experimental}} @@ -14,12 +21,12 @@ jobs: - macos ruby: - - 2.6 - - 2.7 + - "2.7" - "3.0" + - "3.1" + - "3.2" experimental: [false] - env: [""] include: - os: ubuntu @@ -33,12 +40,12 @@ jobs: experimental: true steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: ruby/setup-ruby@v1 with: ruby-version: ${{matrix.ruby}} bundler-cache: true - name: Run tests - timeout-minutes: 5 - run: ${{matrix.env}} bundle exec rspec + timeout-minutes: 10 + run: bundle exec bake test diff --git a/.gitignore b/.gitignore index 1a362b8..48c4288 100644 --- a/.gitignore +++ b/.gitignore @@ -1,13 +1,8 @@ /.bundle/ -/.yardoc -/gems.locked -/_yardoc/ -/coverage/ -/doc/ /pkg/ -/spec/reports/ -/tmp/ +/gems.locked +/.covered.db +/external -# rspec failure tracking -.rspec_status -.covered.db +/.rspec +/.rspec_status diff --git a/async-rspec.gemspec b/async-rspec.gemspec index c3e91e7..88f783c 100644 --- a/async-rspec.gemspec +++ b/async-rspec.gemspec @@ -1,3 +1,4 @@ +# frozen_string_literal: true require_relative "lib/async/rspec/version" @@ -6,12 +7,15 @@ Gem::Specification.new do |spec| spec.version = Async::RSpec::VERSION spec.summary = "Helpers for writing specs against the async gem." - spec.authors = ["Samuel Williams"] + spec.authors = ["Samuel Williams", "Janko Marohnić", "Olle Jonsson", "Cyril Roelandt", "Jeremy Jung", "Robin Goos"] spec.license = "MIT" + spec.cert_chain = ['release.cert'] + spec.signing_key = File.expand_path('~/.gem/release.pem') + spec.homepage = "https://github.com/socketry/async-rspec" - spec.files = Dir.glob('{lib}/**/*', File::FNM_DOTMATCH, base: __dir__) + spec.files = Dir.glob(['{lib}/**/*', '*.md'], File::FNM_DOTMATCH, base: __dir__) spec.add_dependency "rspec", "~> 3.0" spec.add_dependency "rspec-files", "~> 1.0" diff --git a/gems.rb b/gems.rb index 8ed8807..05857b3 100644 --- a/gems.rb +++ b/gems.rb @@ -1,3 +1,8 @@ +# frozen_string_literal: true + +# Released under the MIT License. +# Copyright, 2017-2023, by Samuel Williams. + source 'https://rubygems.org' # Specify your gem's dependencies in async-rspec.gemspec @@ -5,11 +10,13 @@ # gem "async", path: "../async" +gem "rugged", "= 1.4.4" + group :maintenance, optional: true do gem "bake-modernize" - gem "bake-bundler" + gem "bake-gem" end group :test do - gem "ruby-prof", git: "https://github.com/ruby-prof/ruby-prof" + gem "bake-test" end diff --git a/gems/async-head.rb b/gems/async-head.rb deleted file mode 100644 index 50345f7..0000000 --- a/gems/async-head.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -source 'https://rubygems.org' - -gemspec path: "../" - -gem 'async', git: "https://github.com/socketry/async" diff --git a/gems/async-v1.rb b/gems/async-v1.rb index cc6730c..bfede80 100644 --- a/gems/async-v1.rb +++ b/gems/async-v1.rb @@ -1,5 +1,8 @@ # frozen_string_literal: true +# Released under the MIT License. +# Copyright, 2021, by Samuel Williams. + source 'https://rubygems.org' gemspec path: "../" diff --git a/gems/async-v2.rb b/gems/async-v2.rb new file mode 100644 index 0000000..906c7b5 --- /dev/null +++ b/gems/async-v2.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +# Released under the MIT License. +# Copyright, 2021-2023, by Samuel Williams. + +source 'https://rubygems.org' + +gemspec path: "../" + +gem 'async', '~> 2.0' diff --git a/lib/async/rspec.rb b/lib/async/rspec.rb index 6ea8f00..b24d6da 100644 --- a/lib/async/rspec.rb +++ b/lib/async/rspec.rb @@ -1,22 +1,7 @@ -# Copyright, 2017, by Samuel G. D. Williams. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. +# frozen_string_literal: true + +# Released under the MIT License. +# Copyright, 2017-2018, by Samuel Williams. require_relative "rspec/version" require_relative "rspec/reactor" diff --git a/lib/async/rspec/buffer.rb b/lib/async/rspec/buffer.rb index 8b58f1b..450e1f9 100644 --- a/lib/async/rspec/buffer.rb +++ b/lib/async/rspec/buffer.rb @@ -1,22 +1,7 @@ -# Copyright, 2018, by Samuel G. D. Williams. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. +# frozen_string_literal: true + +# Released under the MIT License. +# Copyright, 2018, by Samuel Williams. require 'securerandom' diff --git a/lib/async/rspec/leaks.rb b/lib/async/rspec/leaks.rb index 3820b8a..80b24fc 100644 --- a/lib/async/rspec/leaks.rb +++ b/lib/async/rspec/leaks.rb @@ -1,22 +1,7 @@ -# Copyright, 2017, by Samuel G. D. Williams. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. +# frozen_string_literal: true + +# Released under the MIT License. +# Copyright, 2017-2019, by Samuel Williams. require 'rspec/files' diff --git a/lib/async/rspec/memory.rb b/lib/async/rspec/memory.rb index 8c40019..5521288 100644 --- a/lib/async/rspec/memory.rb +++ b/lib/async/rspec/memory.rb @@ -1,22 +1,8 @@ -# Copyright, 2017, by Samuel G. D. Williams. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. +# frozen_string_literal: true + +# Released under the MIT License. +# Copyright, 2018-2019, by Samuel Williams. +# Copyright, 2018, by Janko Marohnić. require 'rspec/memory' diff --git a/lib/async/rspec/profile.rb b/lib/async/rspec/profile.rb index 0034be5..d2bc64e 100644 --- a/lib/async/rspec/profile.rb +++ b/lib/async/rspec/profile.rb @@ -1,52 +1,16 @@ -# Copyright, 2017, by Samuel G. D. Williams. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. +# frozen_string_literal: true + +# Released under the MIT License. +# Copyright, 2017-2018, by Samuel Williams. module Async module RSpec module Profile end - begin - require 'ruby-prof' - - ::RSpec.shared_context Profile do - around(:each) do |example| - profile = RubyProf::Profile.new(merge_fibers: true) - - begin - profile.start - - example.run - ensure - profile.stop - - printer = RubyProf::FlatPrinter.new(profile) - printer.print(STDOUT) - end - end - end - rescue LoadError - ::RSpec.shared_context Profile do - before(:all) do - warn "Profiling not enabled/supported." - end + ::RSpec.shared_context Profile do + before(:all) do + warn "Profiling not enabled/supported." end end end diff --git a/lib/async/rspec/reactor.rb b/lib/async/rspec/reactor.rb index 0c5cba3..9bf5f6e 100644 --- a/lib/async/rspec/reactor.rb +++ b/lib/async/rspec/reactor.rb @@ -78,11 +78,13 @@ def run_in_reactor(reactor, duration = nil) include Reactor let(:reactor) {@reactor} + # This is fiber local: rspec_context = Thread.current[:__rspec] + include_context Async::RSpec::Leaks around(:each) do |example| - duration = example.metadata.fetch(:timeout, 10) + duration = example.metadata.fetch(:timeout, 60) begin Sync do |task| diff --git a/lib/async/rspec/ssl.rb b/lib/async/rspec/ssl.rb index 9636d3b..bbe46ae 100644 --- a/lib/async/rspec/ssl.rb +++ b/lib/async/rspec/ssl.rb @@ -1,22 +1,7 @@ -# Copyright, 2018, by Samuel G. D. Williams. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. +# frozen_string_literal: true + +# Released under the MIT License. +# Copyright, 2018-2021, by Samuel Williams. require 'openssl' diff --git a/lib/async/rspec/version.rb b/lib/async/rspec/version.rb index 7668fca..0564255 100644 --- a/lib/async/rspec/version.rb +++ b/lib/async/rspec/version.rb @@ -1,22 +1,7 @@ -# Copyright, 2017, by Samuel G. D. Williams. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. +# frozen_string_literal: true + +# Released under the MIT License. +# Copyright, 2017-2021, by Samuel Williams. module Async module RSpec diff --git a/license.md b/license.md new file mode 100644 index 0000000..77b6789 --- /dev/null +++ b/license.md @@ -0,0 +1,26 @@ +# MIT License + +Copyright, 2017-2023, by Samuel Williams. +Copyright, 2018, by Janko Marohnić. +Copyright, 2019, by Jeremy Jung. +Copyright, 2019, by Cyril Roelandt. +Copyright, 2020-2021, by Olle Jonsson. +Copyright, 2023, by Robin Goos. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/readme.md similarity index 61% rename from README.md rename to readme.md index 0889674..790a923 100644 --- a/README.md +++ b/readme.md @@ -2,7 +2,7 @@ Provides useful `RSpec.shared_context`s for testing code that builds on top of [async](https://github.com/socketry/async). -[![Development Status](https://github.com/socketry/async-rspec/workflows/Development/badge.svg)](https://github.com/socketry/async-rspec/actions?workflow=Development) +[![Development Status](https://github.com/socketry/async-rspec/workflows/Test/badge.svg)](https://github.com/socketry/async-rspec/actions?workflow=Test) ## Installation @@ -85,32 +85,10 @@ This functionality was moved to [`rspec-memory`](https://github.com/socketry/rsp ## Contributing -1. Fork it -2. Create your feature branch (`git checkout -b my-new-feature`) -3. Commit your changes (`git commit -am 'Add some feature'`) -4. Push to the branch (`git push origin my-new-feature`) -5. Create new Pull Request +We welcome contributions to this project. -## License - -Released under the MIT license. - -Copyright, 2017, by [Samuel G. D. Williams](http://www.codeotaku.com/samuel-williams). - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. +1. Fork it. +2. Create your feature branch (`git checkout -b my-new-feature`). +3. Commit your changes (`git commit -am 'Add some feature'`). +4. Push to the branch (`git push origin my-new-feature`). +5. Create new Pull Request. diff --git a/release.cert b/release.cert new file mode 100644 index 0000000..d98e595 --- /dev/null +++ b/release.cert @@ -0,0 +1,28 @@ +-----BEGIN CERTIFICATE----- +MIIE2DCCA0CgAwIBAgIBATANBgkqhkiG9w0BAQsFADBhMRgwFgYDVQQDDA9zYW11 +ZWwud2lsbGlhbXMxHTAbBgoJkiaJk/IsZAEZFg1vcmlvbnRyYW5zZmVyMRIwEAYK +CZImiZPyLGQBGRYCY28xEjAQBgoJkiaJk/IsZAEZFgJuejAeFw0yMjA4MDYwNDUz +MjRaFw0zMjA4MDMwNDUzMjRaMGExGDAWBgNVBAMMD3NhbXVlbC53aWxsaWFtczEd +MBsGCgmSJomT8ixkARkWDW9yaW9udHJhbnNmZXIxEjAQBgoJkiaJk/IsZAEZFgJj +bzESMBAGCgmSJomT8ixkARkWAm56MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIB +igKCAYEAomvSopQXQ24+9DBB6I6jxRI2auu3VVb4nOjmmHq7XWM4u3HL+pni63X2 +9qZdoq9xt7H+RPbwL28LDpDNflYQXoOhoVhQ37Pjn9YDjl8/4/9xa9+NUpl9XDIW +sGkaOY0eqsQm1pEWkHJr3zn/fxoKPZPfaJOglovdxf7dgsHz67Xgd/ka+Wo1YqoE +e5AUKRwUuvaUaumAKgPH+4E4oiLXI4T1Ff5Q7xxv6yXvHuYtlMHhYfgNn8iiW8WN +XibYXPNP7NtieSQqwR/xM6IRSoyXKuS+ZNGDPUUGk8RoiV/xvVN4LrVm9upSc0ss +RZ6qwOQmXCo/lLcDUxJAgG95cPw//sI00tZan75VgsGzSWAOdjQpFM0l4dxvKwHn +tUeT3ZsAgt0JnGqNm2Bkz81kG4A2hSyFZTFA8vZGhp+hz+8Q573tAR89y9YJBdYM +zp0FM4zwMNEUwgfRzv1tEVVUEXmoFCyhzonUUw4nE4CFu/sE3ffhjKcXcY//qiSW +xm4erY3XAgMBAAGjgZowgZcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAwHQYDVR0O +BBYEFO9t7XWuFf2SKLmuijgqR4sGDlRsMC4GA1UdEQQnMCWBI3NhbXVlbC53aWxs +aWFtc0BvcmlvbnRyYW5zZmVyLmNvLm56MC4GA1UdEgQnMCWBI3NhbXVlbC53aWxs +aWFtc0BvcmlvbnRyYW5zZmVyLmNvLm56MA0GCSqGSIb3DQEBCwUAA4IBgQB5sxkE +cBsSYwK6fYpM+hA5B5yZY2+L0Z+27jF1pWGgbhPH8/FjjBLVn+VFok3CDpRqwXCl +xCO40JEkKdznNy2avOMra6PFiQyOE74kCtv7P+Fdc+FhgqI5lMon6tt9rNeXmnW/ +c1NaMRdxy999hmRGzUSFjozcCwxpy/LwabxtdXwXgSay4mQ32EDjqR1TixS1+smp +8C/NCWgpIfzpHGJsjvmH2wAfKtTTqB9CVKLCWEnCHyCaRVuKkrKjqhYCdmMBqCws +JkxfQWC+jBVeG9ZtPhQgZpfhvh+6hMhraUYRQ6XGyvBqEUe+yo6DKIT3MtGE2+CP +eX9i9ZWBydWb8/rvmwmX2kkcBbX0hZS1rcR593hGc61JR6lvkGYQ2MYskBveyaxt +Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8 +voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg= +-----END CERTIFICATE----- diff --git a/spec/async/rspec/buffer_spec.rb b/spec/async/rspec/buffer_spec.rb index d6c64fc..0150a01 100644 --- a/spec/async/rspec/buffer_spec.rb +++ b/spec/async/rspec/buffer_spec.rb @@ -1,22 +1,7 @@ -# Copyright, 2018, by Samuel G. D. Williams. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. +# frozen_string_literal: true + +# Released under the MIT License. +# Copyright, 2018, by Samuel Williams. require 'async/rspec/buffer' diff --git a/spec/async/rspec/leaks_spec.rb b/spec/async/rspec/leaks_spec.rb index 256f36f..7f1531a 100644 --- a/spec/async/rspec/leaks_spec.rb +++ b/spec/async/rspec/leaks_spec.rb @@ -1,22 +1,7 @@ -# Copyright, 2017, by Samuel G. D. Williams. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. +# frozen_string_literal: true + +# Released under the MIT License. +# Copyright, 2017-2019, by Samuel Williams. require 'async/rspec/leaks' diff --git a/spec/async/rspec/memory_spec.rb b/spec/async/rspec/memory_spec.rb index 29bfdf0..f213e01 100644 --- a/spec/async/rspec/memory_spec.rb +++ b/spec/async/rspec/memory_spec.rb @@ -1,22 +1,8 @@ -# Copyright, 2017, by Samuel G. D. Williams. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. +# frozen_string_literal: true + +# Released under the MIT License. +# Copyright, 2018-2019, by Samuel Williams. +# Copyright, 2018, by Janko Marohnić. require 'async/rspec/memory' diff --git a/spec/async/rspec/profile_spec.rb b/spec/async/rspec/profile_spec.rb index 2f99de8..4063287 100644 --- a/spec/async/rspec/profile_spec.rb +++ b/spec/async/rspec/profile_spec.rb @@ -1,22 +1,7 @@ -# Copyright, 2017, by Samuel G. D. Williams. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. +# frozen_string_literal: true + +# Released under the MIT License. +# Copyright, 2017-2019, by Samuel Williams. require 'async' require 'async/rspec/profile' diff --git a/spec/async/rspec/reactor_spec.rb b/spec/async/rspec/reactor_spec.rb index 1a6558a..beb90b7 100644 --- a/spec/async/rspec/reactor_spec.rb +++ b/spec/async/rspec/reactor_spec.rb @@ -1,22 +1,8 @@ -# Copyright, 2017, by Samuel G. D. Williams. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. +# frozen_string_literal: true + +# Released under the MIT License. +# Copyright, 2017-2021, by Samuel Williams. +# Copyright, 2023, by Robin Goos. require 'async/rspec/reactor' require 'async/io/generic' diff --git a/spec/async/rspec/ssl_spec.rb b/spec/async/rspec/ssl_spec.rb index ae4f0bd..8ae8001 100644 --- a/spec/async/rspec/ssl_spec.rb +++ b/spec/async/rspec/ssl_spec.rb @@ -1,22 +1,7 @@ -# Copyright, 2018, by Samuel G. D. Williams. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. +# frozen_string_literal: true + +# Released under the MIT License. +# Copyright, 2018-2020, by Samuel Williams. require 'async/rspec/ssl' diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index ba5b504..b63625f 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,3 +1,7 @@ +# frozen_string_literal: true + +# Released under the MIT License. +# Copyright, 2017-2019, by Samuel Williams. require 'covered/rspec' From c7804844b79d04607aa53337d5e2d789688f791d Mon Sep 17 00:00:00 2001 From: Samuel Williams Date: Mon, 5 Jun 2023 12:22:56 +0900 Subject: [PATCH 3/4] Update gem dependencies. --- gems.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gems.rb b/gems.rb index 05857b3..f4131a6 100644 --- a/gems.rb +++ b/gems.rb @@ -5,7 +5,6 @@ source 'https://rubygems.org' -# Specify your gem's dependencies in async-rspec.gemspec gemspec # gem "async", path: "../async" @@ -15,6 +14,8 @@ group :maintenance, optional: true do gem "bake-modernize" gem "bake-gem" + + gem "utopia-project" end group :test do From ebe3d9e879a421e5c171ecfcd83a99eae4d81df9 Mon Sep 17 00:00:00 2001 From: Samuel Williams Date: Mon, 5 Jun 2023 12:52:56 +0900 Subject: [PATCH 4/4] Bump minor version. --- lib/async/rspec/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/async/rspec/version.rb b/lib/async/rspec/version.rb index 0564255..58eb469 100644 --- a/lib/async/rspec/version.rb +++ b/lib/async/rspec/version.rb @@ -5,6 +5,6 @@ module Async module RSpec - VERSION = "1.16.1" + VERSION = "1.17.0" end end