rspec-pending-for-0.1.3/0000755000175000017500000000000012665575275012627 5ustar chchrspec-pending-for-0.1.3/metadata.yml0000644000175000017500000000662612665575275015144 0ustar chch--- !ruby/object:Gem::Specification name: rspec-pending_for version: !ruby/object:Gem::Version version: 0.1.3 platform: ruby authors: - Peter Boling autorequire: bindir: exe cert_chain: [] date: 2015-10-22 00:00:00.000000000 Z dependencies: - !ruby/object:Gem::Dependency name: rspec-core requirement: !ruby/object:Gem::Requirement requirements: - - ">=" - !ruby/object:Gem::Version version: '0' type: :runtime prerelease: false version_requirements: !ruby/object:Gem::Requirement requirements: - - ">=" - !ruby/object:Gem::Version version: '0' - !ruby/object:Gem::Dependency name: ruby_version requirement: !ruby/object:Gem::Requirement requirements: - - "~>" - !ruby/object:Gem::Version version: '1.0' type: :runtime prerelease: false version_requirements: !ruby/object:Gem::Requirement requirements: - - "~>" - !ruby/object:Gem::Version version: '1.0' - !ruby/object:Gem::Dependency name: ruby_engine requirement: !ruby/object:Gem::Requirement requirements: - - "~>" - !ruby/object:Gem::Version version: '1.0' type: :runtime prerelease: false version_requirements: !ruby/object:Gem::Requirement requirements: - - "~>" - !ruby/object:Gem::Version version: '1.0' - !ruby/object:Gem::Dependency name: bundler requirement: !ruby/object:Gem::Requirement requirements: - - "~>" - !ruby/object:Gem::Version version: '1.10' type: :development prerelease: false version_requirements: !ruby/object:Gem::Requirement requirements: - - "~>" - !ruby/object:Gem::Version version: '1.10' - !ruby/object:Gem::Dependency name: rake requirement: !ruby/object:Gem::Requirement requirements: - - "~>" - !ruby/object:Gem::Version version: '10.0' type: :development prerelease: false version_requirements: !ruby/object:Gem::Requirement requirements: - - "~>" - !ruby/object:Gem::Version version: '10.0' - !ruby/object:Gem::Dependency name: rspec requirement: !ruby/object:Gem::Requirement requirements: - - "~>" - !ruby/object:Gem::Version version: '3.3' type: :development prerelease: false version_requirements: !ruby/object:Gem::Requirement requirements: - - "~>" - !ruby/object:Gem::Version version: '3.3' description: email: - peter.boling@gmail.com executables: [] extensions: [] extra_rdoc_files: [] files: - ".gitignore" - ".rspec" - ".travis.yml" - Gemfile - LICENSE - README.md - Rakefile - bin/console - bin/setup - lib/rspec/pending_for.rb - lib/rspec/pending_for/build.rb - lib/rspec/pending_for/engine_or_versions_required.rb - lib/rspec/pending_for/rspec.rb - lib/rspec/pending_for/version.rb - rspec-pending_for.gemspec homepage: https://github.com/pboling/rspec-pending_for licenses: [] metadata: {} post_install_message: rdoc_options: [] require_paths: - lib required_ruby_version: !ruby/object:Gem::Requirement requirements: - - ">=" - !ruby/object:Gem::Version version: '0' required_rubygems_version: !ruby/object:Gem::Requirement requirements: - - ">=" - !ruby/object:Gem::Version version: '0' requirements: [] rubyforge_project: rubygems_version: 2.4.5.1 signing_key: specification_version: 4 summary: Mark specs pending or skipped for specific Ruby engine (e.g. MRI or JRuby) / version combinations test_files: [] rspec-pending-for-0.1.3/README.md0000644000175000017500000001257012665575275014113 0ustar chch# Rspec::PendingFor Easiest to just show you: ```ruby it("blah is blah") do pending_for(engine: "ruby", version: "2.1.5") pending_for(engine: "jruby", version: "2.2.2") expect("blah").to eq "blah" end ``` Requires Ruby 1.9+ (any engine) | Project | Rspec::PendingFor | |------------------------ | ------------------ | | gem name | rspec-pending_for | | license | MIT | | version | [![Gem Version](https://badge.fury.io/rb/rspec-pending_for.png)](http://badge.fury.io/rb/rspec-pending_for) | | dependencies | [![Dependency Status](https://gemnasium.com/pboling/rspec-pending_for.png)](https://gemnasium.com/pboling/rspec-pending_for) | | code quality | [![Code Climate](https://codeclimate.com/github/pboling/rspec-pending_for.png)](https://codeclimate.com/github/pboling/rspec-pending_for) | | inline documenation | [![Inline docs](http://inch-ci.org/github/pboling/rspec-pending_for.png)](http://inch-ci.org/github/pboling/rspec-pending_for) | | continuous integration | [![Build Status](https://secure.travis-ci.org/pboling/rspec-pending_for.png?branch=master)](https://travis-ci.org/pboling/rspec-pending_for) | | homepage | [https://github.com/pboling/rspec-pending_for][homepage] | | documentation | [http://rdoc.info/github/pboling/rspec-pending_for/frames][documentation] | | author | [Peter Boling](https://coderbits.com/pboling) | | Spread ~♡ⓛⓞⓥⓔ♡~ | [![Endorse Me](https://api.coderwall.com/pboling/endorsecount.png)](http://coderwall.com/pboling) | ## Installation Add this line to your application's Gemfile: ```ruby gem 'rspec-pending_for' ``` And then execute: $ bundle Or install it yourself as: $ gem install rspec-pending_for ## Usage The gem auto-configures itself for use in your Rspec suite. Just use it! To mark a spec pending for a specific ruby engine, and/or versions: ```ruby it("blah is blah") do pending_for(engine: "ruby", version: "2.1.5") expect("blah").to eq "blah" end ``` To skip a spec for a specific ruby engine, and/or versions: ```ruby it("blah is blah") do skip_for(engine: "ruby", version: "2.1.5") expect("blah").to eq "blah" end ``` To mark a spec pending for all versions of a given engine: ```ruby it("blah is blah") do skip_for(engine: "jruby") expect("blah").to eq "blah" end ``` To mark a spec pending for a custom reason (overriding the default message): ```ruby it("blah is blah") do skip_for(engine: "jruby", reason: "This does not work on JRuby") expect("blah").to eq "blah" end ``` To mark a spec pending or skipped for multiple engines and versions, just what you would expect: ```ruby it("blah is blah") do skip_for(engine: "jruby", reason: "This does not work on JRuby so skipping for now") # All JRuby versions will be skipped pending_for(engine: "rbx", reason: "This does not work on Rubinius so pending for now") # All rbx versions will be pending pending_for(engine: "ruby", versions:%w(1.9.3 2.0.0 2.1.0)) # uses the default message expect("blah").to eq "blah" end ``` ## Development After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org). ## Authors [Peter H. Boling][peterboling] of [Rails Bling][railsbling] is the author. ## Contributors See the [Network View](https://github.com/pboling/rspec-pending_for/network) and the [CHANGELOG](https://github.com/pboling/rspec-pending_for/blob/master/CHANGELOG.md) ## Contributing 1. Fork it 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am 'Added some feature'`) 4. Push to the branch (`git push origin my-new-feature`) 5. Make sure to add tests for it. This is important so I don't break it in a future version unintentionally. 6. Create new Pull Request Bug reports and pull requests are welcome on GitHub at https://github.com/pboling/rspec-pending_for. ## Versioning This library aims to adhere to [Semantic Versioning 2.0.0][semver]. Violations of this scheme should be reported as bugs. Specifically, if a minor or patch version is released that breaks backward compatibility, a new version should be immediately released that restores compatibility. Breaking changes to the public API will only be introduced with new major versions. As a result of this policy, you can (and should) specify a dependency on this gem using the [Pessimistic Version Constraint][pvc] with two digits of precision. For example: spec.add_dependency 'rspec-pending_for', '~> 1.1' ## Legal * MIT License - See LICENSE file in this project * Copyright (c) 2015 [Peter H. Boling][peterboling] of [Rails Bling][railsbling] [semver]: http://semver.org/ [pvc]: http://docs.rubygems.org/read/chapter/16#page74 [railsbling]: http://www.railsbling.com [peterboling]: https://about.me/peter.boling [documentation]: http://rdoc.info/github/pboling/rspec-pending_for/frames [homepage]: https://github.com/pboling/rspec-pending_for rspec-pending-for-0.1.3/.gitignore0000644000175000017500000000013512665575275014616 0ustar chch/.bundle/ /.yardoc /Gemfile.lock /_yardoc/ /coverage/ /doc/ /pkg/ /spec/reports/ /tmp/ *.gem rspec-pending-for-0.1.3/.travis.yml0000644000175000017500000000024712665575275014743 0ustar chchlanguage: ruby rvm: - 1.9.2 - 1.9.3 - 2.0.0 - 2.1.7 - 2.2.3 - rbx - jruby - jruby-9.0.1.0 - jruby-head before_install: gem install bundler -v 1.10.6 rspec-pending-for-0.1.3/LICENSE0000644000175000017500000000210212665575275013627 0ustar chchCopyright (c) 2015 Peter H. Boling of RailsBling.com MIT License 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. rspec-pending-for-0.1.3/.rspec0000644000175000017500000000003712665575275013744 0ustar chch--format documentation --color rspec-pending-for-0.1.3/lib/0000755000175000017500000000000012665575275013375 5ustar chchrspec-pending-for-0.1.3/lib/rspec/0000755000175000017500000000000012665575275014511 5ustar chchrspec-pending-for-0.1.3/lib/rspec/pending_for/0000755000175000017500000000000012665575275017003 5ustar chchrspec-pending-for-0.1.3/lib/rspec/pending_for/build.rb0000644000175000017500000000620712665575275020434 0ustar chchmodule Rspec module PendingFor # SRP: Describe the RubyEngine and/or RubyVersion(s) that will be pended or skipped and with what message class Build # # | RUBY_ENGINE | Implementation | # |:-----------:|:------------------------:| # | "unknown" | MRI < 1.9 (probably) | # | "ruby" | MRI >= 1.9 | # | "ree" | Ruby Enterprise Edition | # | "jruby" | JRuby | # | "macruby" | MacRuby | # | "rbx" | Rubinius | # | "maglev" | MagLev | # | "ironruby" | IronRuby | # | "cardinal" | Cardinal | # # Keys are the INTERPRETER_MATRIX = { "unknown" => "MRI < 1.9 (probably)", "ruby" => "MRI >= 1.9", "ree" => "Ruby Enterprise Edition", "jruby" => "JRuby", "macruby" => "MacRuby", "rbx" => "Rubinius", "maglev" => "MagLev", "ironruby" => "IronRuby", "cardinal" => "Cardinal" } BROKEN_STRING = "Behavior is broken" BUG_STRING = "due to a bug in the Ruby engine" VERSIONS_STRING = "in Ruby versions" ISSUES_LINK = "https://github.com/pboling/rspec-pending_for/issues" attr_reader :message, :relevant_versions, :relevant_engine, :reason def initialize(options = {}) @relevant_versions = Array(options[:versions]) # cast to array @relevant_engine = options[:engine].nil? ? nil : options[:engine].to_s @reason = options[:reason] warn_about_unrecognized_engine # If engine is nil, then any matching versions should be pended @message = if @relevant_engine.nil? no_engine_specified elsif RubyEngine.is? @relevant_engine engine_specified_and_relevant end end def current_matches_specified? !message.nil? end private def warn_about_unrecognized_engine return false if relevant_engine.nil? || !INTERPRETER_MATRIX[relevant_engine].nil? warn %[ Engine specified (#{relevant_engine}) is not known to rspec-pending_for. If it is a real RUBY_ENGINE, please report as a bug to #{ISSUES_LINK} ] end def no_engine_specified if relevant_versions.include?(RubyVersion.to_s) reason || "#{BROKEN_STRING} #{VERSIONS_STRING} #{relevant_versions} #{BUG_STRING}" else nil # Not a pended/skipped spec end end def engine_specified_and_relevant if relevant_versions.empty? # No versions specified means ALL versions for this engine reason || "#{BROKEN_STRING} #{BUG_STRING} #{INTERPRETER_MATRIX[relevant_engine]}" else if relevant_versions.include?(RubyVersion.to_s) reason || %[#{BROKEN_STRING} #{VERSIONS_STRING} #{relevant_versions} #{BUG_STRING} (#{INTERPRETER_MATRIX[relevant_engine]})] else nil # Not a pended/skipped spec end end end end end end rspec-pending-for-0.1.3/lib/rspec/pending_for/rspec.rb0000644000175000017500000000023312665575275020442 0ustar chchrequire "rspec/core" begin RSpec.configure do |c| c.include Rspec::PendingFor end rescue NameError # Rspec really should be loaded by now... end rspec-pending-for-0.1.3/lib/rspec/pending_for/engine_or_versions_required.rb0000644000175000017500000000042412665575275025125 0ustar chchmodule Rspec module PendingFor class EngineOrVersionsRequired < ArgumentError def initialize(method_name, *args) message = "#{method_name} requires at least an engine or versions to be specified" super(message, *args) end end end end rspec-pending-for-0.1.3/lib/rspec/pending_for/version.rb0000644000175000017500000000010112665575275021005 0ustar chchmodule Rspec module PendingFor VERSION = "0.1.3" end end rspec-pending-for-0.1.3/lib/rspec/pending_for.rb0000644000175000017500000000267712665575275017344 0ustar chchrequire "ruby_version" require "ruby_engine" require "rspec/pending_for/version" require "rspec/pending_for/engine_or_versions_required" require "rspec/pending_for/build" require "rspec/pending_for/rspec" module Rspec # Use with Rspec by including in your example groups, just like any other Rspec helpers: # # RSpec.configure do |c| # c.include Rspec::PendingFor # end # module PendingFor # How to pend specs that break due to bugs in Ruby interpreters or versions # # it("blah is blah") do # pending_for(engine: "ruby", version: "2.1.5") # expect("blah").to eq "blah" # end # def pending_for(options = {}) # Not using named parameters because still supporting Ruby 1.9 modify_example_with(:pending, options) end # How to pend specs that break due to bugs in Ruby interpreters or versions # # it("blah is blah") do # skip_for(engine: "jruby", version: "2.2.2") # expect("blah").to eq "blah" # end # def skip_for(options = {}) # Not using named parameters because still supporting Ruby 1.9 modify_example_with(:skip, options) end private def modify_example_with(message, options) fail(EngineOrVersionsRequired, :pending_for) unless options[:engine] || options[:versions] build = Build.new(options) self.send(message, build.message) if build.current_matches_specified? end end end rspec-pending-for-0.1.3/rspec-pending_for.gemspec0000644000175000017500000000211212665575275017574 0ustar chch# coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'rspec/pending_for/version' Gem::Specification.new do |spec| spec.name = "rspec-pending_for" spec.version = Rspec::PendingFor::VERSION spec.authors = ["Peter Boling"] spec.email = ["peter.boling@gmail.com"] spec.summary = %q{Mark specs pending or skipped for specific Ruby engine (e.g. MRI or JRuby) / version combinations} spec.homepage = "https://github.com/pboling/rspec-pending_for" spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } spec.bindir = "exe" spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ["lib"] spec.add_dependency "rspec-core" spec.add_dependency "ruby_version", "~> 1.0" spec.add_dependency "ruby_engine", "~> 1.0" spec.add_development_dependency "bundler", "~> 1.10" spec.add_development_dependency "rake", "~> 10.0" spec.add_development_dependency "rspec", "~> 3.3" end rspec-pending-for-0.1.3/Gemfile0000644000175000017500000000014612665575275014123 0ustar chchsource 'https://rubygems.org' # Specify your gem's dependencies in rspec-pending_for.gemspec gemspec rspec-pending-for-0.1.3/Rakefile0000644000175000017500000000016512665575275014276 0ustar chchrequire "bundler/gem_tasks" require "rspec/core/rake_task" RSpec::Core::RakeTask.new(:spec) task :default => :spec rspec-pending-for-0.1.3/bin/0000755000175000017500000000000012665575275013377 5ustar chchrspec-pending-for-0.1.3/bin/console0000755000175000017500000000052612665575275014772 0ustar chch#!/usr/bin/env ruby require "bundler/setup" require "rspec/pending_for" # You can add fixtures and/or initialization code here to make experimenting # with your gem easier. You can also use a different console, if you like. # (If you use this, don't forget to add pry to your Gemfile!) # require "pry" # Pry.start require "irb" IRB.start rspec-pending-for-0.1.3/bin/setup0000755000175000017500000000016312665575275014465 0ustar chch#!/bin/bash set -euo pipefail IFS=$'\n\t' bundle install # Do any other automated setup that you need to do here