Skip to content

Commit

Permalink
Merge pull request #33 from laserlemon/v0-0-10
Browse files Browse the repository at this point in the history
Prepare v0.0.10 release
  • Loading branch information
laserlemon committed Apr 26, 2024
2 parents 8258760 + 87f5496 commit 3359e32
Show file tree
Hide file tree
Showing 19 changed files with 123 additions and 122 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/rake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Rake
on:
push:
branches:
- v0
pull_request:
branches:
- v0
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby-version:
- "2.3"
- "2.4"
gemfile-path:
- gemfiles/rspec_3_0.gemfile
- gemfiles/rspec_3_1.gemfile
- gemfiles/rspec_3_2.gemfile
- gemfiles/rspec_3_3.gemfile
- gemfiles/rspec_3_4.gemfile
- gemfiles/rspec_3_5.gemfile
- gemfiles/rspec_3_6.gemfile
- gemfiles/rspec_3_7.gemfile
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/${{ matrix.gemfile-path }}
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
- name: Run tests
run: bundle exec rake
13 changes: 6 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
/.bundle/
/.yardoc
/Gemfile.lock
/gemfiles/*.lock
/_yardoc/
/coverage/
/doc/
/pkg/
/spec/reports/
/tmp/
*.bundle
*.so
*.o
*.a
mkmf.log

# rspec failure tracking
.rspec_status

/Gemfile.lock
/gemfiles/*.lock
34 changes: 21 additions & 13 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,31 @@
# This should always correspond to the earliest non-EOL Ruby version.
AllCops:
NewCops: disable
SuggestExtensions: false
TargetRubyVersion: 2.2

# TODO: Re-enable this cop after TomDoc code deocumentation is added.
Style/Documentation:
Gemspec/DevelopmentDependencies:
Enabled: false

Layout/FirstArrayElementIndentation:
EnforcedStyle: consistent
Layout/LineEndStringConcatenationIndentation:
EnforcedStyle: indented

Metrics:
Enabled: false

Naming/RescuedExceptionsVariableName:
Enabled: false

Metrics/BlockLength:
ExcludedMethods:
- context
- describe
Metrics/LineLength:
IgnoreCopDirectives: true
Style/BlockDelimiters:
EnforcedStyle: semantic
FunctionalMethods:
- expect
- let
EnforcedStyle: braces_for_chaining
Style/Documentation:
Enabled: false
Style/StringLiterals:
EnforcedStyle: double_quotes
Style/SymbolArray:
EnforcedStyle: brackets
Style/TrailingCommaInArrayLiteral:
EnforcedStyleForMultiline: comma
Style/TrailingCommaInHashLiteral:
EnforcedStyleForMultiline: comma
31 changes: 0 additions & 31 deletions .travis.yml

This file was deleted.

11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
## 0.0.10 / 2024-04-26

* [DEPRECATION] Passing an argument to wait_for or wait.for (should pass a block)
* [ENHANCEMENT] Added RuboCop for consistent code style

## 0.0.9 / 2016-07-11

* [ENHANCEMENT] Remove support for Ruby versions 1.9 and 2.0
* [ENHANCEMENT] Remove support for all RSpec 2.x versions
* [ENHANCEMENT] Add support for RSpec 3.5

## 0.0.8 / 2015-11-14

* [ENHANCEMENT] Add support for RSpec 3.4
Expand Down
5 changes: 1 addition & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,4 @@ source "https://rubygems.org"

gemspec

group :test do
gem "codeclimate-test-reporter", require: false
gem "rubocop", require: false
end
gem "rubocop", require: false
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ rescue LoadError
task default: [:spec]
else
RuboCop::RakeTask.new(:rubocop)
task default: [:spec, :rubocop]
task default: [:rubocop, :spec]
end
6 changes: 1 addition & 5 deletions gemfiles/rspec_3_0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,5 @@ source "https://rubygems.org"

gemspec path: ".."

gem "rake", "< 11" # See: https://github.com/rspec/rspec-core/pull/2197
gem "rspec", "~> 3.0.0"

group :test do
gem "codeclimate-test-reporter", require: false
gem "rake", "< 11" # See: https://github.com/rspec/rspec-core/pull/2197
end
6 changes: 1 addition & 5 deletions gemfiles/rspec_3_1.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,5 @@ source "https://rubygems.org"

gemspec path: ".."

gem "rake", "< 11" # See: https://github.com/rspec/rspec-core/pull/2197
gem "rspec", "~> 3.1.0"

group :test do
gem "codeclimate-test-reporter", require: false
gem "rake", "< 11" # See: https://github.com/rspec/rspec-core/pull/2197
end
6 changes: 1 addition & 5 deletions gemfiles/rspec_3_2.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,5 @@ source "https://rubygems.org"

gemspec path: ".."

gem "rake", "< 11" # See: https://github.com/rspec/rspec-core/pull/2197
gem "rspec", "~> 3.2.0"

group :test do
gem "codeclimate-test-reporter", require: false
gem "rake", "< 11" # See: https://github.com/rspec/rspec-core/pull/2197
end
6 changes: 1 addition & 5 deletions gemfiles/rspec_3_3.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,5 @@ source "https://rubygems.org"

gemspec path: ".."

gem "rake", "< 11" # See: https://github.com/rspec/rspec-core/pull/2197
gem "rspec", "~> 3.3.0"

group :test do
gem "codeclimate-test-reporter", require: false
gem "rake", "< 11" # See: https://github.com/rspec/rspec-core/pull/2197
end
4 changes: 0 additions & 4 deletions gemfiles/rspec_3_4.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,3 @@ source "https://rubygems.org"
gemspec path: ".."

gem "rspec", "~> 3.4.0"

group :test do
gem "codeclimate-test-reporter", require: false
end
4 changes: 0 additions & 4 deletions gemfiles/rspec_3_5.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,3 @@ source "https://rubygems.org"
gemspec path: ".."

gem "rspec", "~> 3.5.0"

group :test do
gem "codeclimate-test-reporter", require: false
end
4 changes: 0 additions & 4 deletions gemfiles/rspec_3_6.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,3 @@ source "https://rubygems.org"
gemspec path: ".."

gem "rspec", "~> 3.6.0"

group :test do
gem "codeclimate-test-reporter", require: false
end
4 changes: 0 additions & 4 deletions gemfiles/rspec_3_7.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,3 @@ source "https://rubygems.org"
gemspec path: ".."

gem "rspec", "~> 3.7.0"

group :test do
gem "codeclimate-test-reporter", require: false
end
2 changes: 1 addition & 1 deletion lib/rspec/wait/handler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module RSpec
module Wait
module Handler
def handle_matcher(target, *args, &block) # rubocop:disable Metrics/MethodLength
def handle_matcher(target, *args, &block)
failure = nil

Timeout.timeout(RSpec.configuration.wait_timeout) do
Expand Down
16 changes: 7 additions & 9 deletions lib/rspec/wait/target.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,19 @@ class Target < RSpec::Expectations::ExpectationTarget
UndefinedValue = Module.new

# From: https://github.com/rspec/rspec-expectations/blob/v3.0.0/lib/rspec/expectations/expectation_target.rb#L30-L41
# rubocop:disable Metrics/MethodLength
def self.for(value, block, options = {})
if UndefinedValue.equal?(value)
unless block
raise ArgumentError, "You must pass either an argument or a block to `wait_for`." # rubocop:disable Metrics/LineLength
end
raise ArgumentError, "You must pass either an argument or a block to `wait_for`." unless block

new(block, options)
elsif block
raise ArgumentError, "You cannot pass both an argument and a block to `wait_for`." # rubocop:disable Metrics/LineLength
raise ArgumentError, "You cannot pass both an argument and a block to `wait_for`."
else
warn "[DEPRECATION] As of rspec-wait version 1.0, neither wait_for nor wait.for will accept an argument, only a block." # rubocop:disable Metrics/LineLength
warn "[DEPRECATION] As of rspec-wait version 1.0, " \
"neither wait_for nor wait.for will accept an argument, only a block."
new(value, options)
end
end
# rubocop:enable Metrics/MethodLength

# From: https://github.com/rspec/rspec-expectations/blob/v3.0.0/lib/rspec/expectations/expectation_target.rb#L25-L27
def initialize(target, options)
Expand Down Expand Up @@ -47,8 +45,8 @@ def not_to(matcher = nil, message = nil, &block)

private

def with_wait
Wait.with_wait(@wait_options) { yield }
def with_wait(&block)
Wait.with_wait(@wait_options, &block)
end
end
end
Expand Down
48 changes: 33 additions & 15 deletions rspec-wait.gemspec
Original file line number Diff line number Diff line change
@@ -1,24 +1,42 @@
lib = File.expand_path("../lib", __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "rspec/wait/version"
# frozen_string_literal: true

require_relative "lib/rspec/wait/version"

Gem::Specification.new do |spec|
spec.name = "rspec-wait"
spec.version = RSpec::Wait.version
spec.name = "rspec-wait"
spec.summary = "Wait for conditions in RSpec"
spec.description = "RSpec::Wait enables time-resilient expectations in your RSpec test suite."
spec.version = RSpec::Wait::VERSION

spec.author = "Steve Richert"
spec.email = "[email protected]"

spec.summary = "Wait for conditions in RSpec"
spec.description = "RSpec::Wait enables time-resilient expectations in your RSpec test suite." # rubocop:disable Metrics/LineLength
spec.homepage = "https://github.com/laserlemon/rspec-wait"
spec.license = "MIT"

spec.files = `git ls-files -z`.split("\x0")
spec.test_files = spec.files.grep(/^spec/)
spec.email = "[email protected]"
spec.license = "MIT"
spec.homepage = "https://github.com/laserlemon/rspec-wait"

spec.add_dependency "rspec", ">= 3"
spec.metadata = {
"allowed_push_host" => "https://rubygems.org",
"bug_tracker_uri" => "https://github.com/laserlemon/rspec-wait/issues",
"funding_uri" => "https://github.com/sponsors/laserlemon",
"homepage_uri" => "https://github.com/laserlemon/rspec-wait",
"rubygems_mfa_required" => "true",
"source_code_uri" => "https://github.com/laserlemon/rspec-wait",
}

spec.required_ruby_version = ">= 2.2"
spec.add_dependency "rspec", ">= 3.0"
spec.add_development_dependency "bundler"
spec.add_development_dependency "rake"

spec.files = Dir.glob([
"rspec-wait.gemspec",
"lib/**/*.rb",
"LICENSE.txt",
])

spec.extra_rdoc_files = ["README.md"]

spec.post_install_message = <<-MSG
[rspec-wait] RSpec::Wait 1.0 has arrived! Please upgrade for the latest and greatest.
[rspec-wait] See what's changed here: https://github.com/laserlemon/rspec-wait/blob/-/CHANGELOG.md
MSG
end
6 changes: 1 addition & 5 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
if ENV["CODECLIMATE_REPO_TOKEN"]
require "simplecov"
SimpleCov.start
end

require "bundler/setup"
require "rspec/wait"

0 comments on commit 3359e32

Please sign in to comment.