{"id":13394887,"url":"https://github.com/yujinakayama/transpec","last_synced_at":"2025-04-13T22:29:21.081Z","repository":{"id":9738911,"uuid":"11699910","full_name":"yujinakayama/transpec","owner":"yujinakayama","description":"The RSpec syntax converter","archived":false,"fork":false,"pushed_at":"2023-02-21T18:52:49.000Z","size":3202,"stargazers_count":1011,"open_issues_count":13,"forks_count":52,"subscribers_count":18,"default_branch":"master","last_synced_at":"2024-10-29T15:23:25.478Z","etag":null,"topics":["converter","rspec","ruby"],"latest_commit_sha":null,"homepage":"http://yujinakayama.me/transpec/","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"DefinitelyTyped/DefinitelyTyped","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yujinakayama.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2013-07-27T04:30:12.000Z","updated_at":"2024-10-05T18:07:41.000Z","dependencies_parsed_at":"2022-07-08T06:30:25.301Z","dependency_job_id":"43569639-4b9e-4f83-a743-59053d8783dc","html_url":"https://github.com/yujinakayama/transpec","commit_stats":{"total_commits":990,"total_committers":4,"mean_commits":247.5,"dds":0.00303030303030305,"last_synced_commit":"ba82297b8760f989e268de1de35b914d1b03a037"},"previous_names":[],"tags_count":86,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yujinakayama%2Ftranspec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yujinakayama%2Ftranspec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yujinakayama%2Ftranspec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yujinakayama%2Ftranspec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yujinakayama","download_url":"https://codeload.github.com/yujinakayama/transpec/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247535516,"owners_count":20954576,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["converter","rspec","ruby"],"created_at":"2024-07-30T17:01:35.139Z","updated_at":"2025-04-06T19:08:36.534Z","avatar_url":"https://github.com/yujinakayama.png","language":"Ruby","funding_links":[],"categories":["Ruby","Converters"],"sub_categories":[],"readme":"[![Gem Version](https://badge.fury.io/rb/transpec.svg)](http://badge.fury.io/rb/transpec)\n[![Build Status](https://travis-ci.org/yujinakayama/transpec.svg?branch=master\u0026style=flat)](https://travis-ci.org/yujinakayama/transpec)\n[![Coverage Status](https://coveralls.io/repos/yujinakayama/transpec/badge.svg?branch=master\u0026service=github)](https://coveralls.io/github/yujinakayama/transpec?branch=master)\n[![Code Climate](https://codeclimate.com/github/yujinakayama/transpec/badges/gpa.svg)](https://codeclimate.com/github/yujinakayama/transpec)\n\n# Transpec\n\n**Transpec** is a tool for converting your specs to the latest [RSpec](https://relishapp.com/rspec/) syntax with static and dynamic code analysis.\n\nWith Transpec you can upgrade your RSpec 2 specs to RSpec 3 in no time.\nIt supports [conversions](#supported-conversions) for almost all of the RSpec 3 changes – not only the `expect` syntax.\nAlso, you can use it on your RSpec 2 project even if you're not going to upgrade it to RSpec 3 for now.\n\nCheck out the following posts for the new RSpec syntax and the changes in RSpec 3:\n\n* [RSpec's New Expectation Syntax](http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/)\n* [RSpec's new message expectation syntax](http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/)\n* [Notable Changes in RSpec 3](http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/)\n\nIf you are going to use Transpec in the upgrade process to RSpec 3,\nread the RSpec official guide:\n\n* https://relishapp.com/rspec/docs/upgrade\n\n## Examples\n\nHere's an example spec:\n\n```ruby\ndescribe Account do\n  subject(:account) { Account.new(logger) }\n  let(:logger) { mock('logger') }\n\n  describe '#balance' do\n    context 'initially' do\n      it 'is zero' do\n        account.balance.should == 0\n      end\n    end\n  end\n\n  describe '#close' do\n    it 'logs an account closed message' do\n      logger.should_receive(:account_closed).with(account)\n      account.close\n    end\n  end\n\n  describe '#renew' do\n    context 'when the account is not closed' do\n      before do\n        account.stub(:closed?).and_return(false)\n      end\n\n      it 'does not raise error' do\n        lambda { account.renew }.should_not raise_error(Account::RenewalError)\n      end\n    end\n  end\nend\n```\n\nTranspec would convert it to the following form:\n\n```ruby\ndescribe Account do\n  subject(:account) { Account.new(logger) }\n  let(:logger) { double('logger') }\n\n  describe '#balance' do\n    context 'initially' do\n      it 'is zero' do\n        expect(account.balance).to eq(0)\n      end\n    end\n  end\n\n  describe '#close' do\n    it 'logs an account closed message' do\n      expect(logger).to receive(:account_closed).with(account)\n      account.close\n    end\n  end\n\n  describe '#renew' do\n    context 'when the account is not closed' do\n      before do\n        allow(account).to receive(:closed?).and_return(false)\n      end\n\n      it 'does not raise error' do\n        expect { account.renew }.not_to raise_error\n      end\n    end\n  end\nend\n```\n\n### Actual examples\n\nYou can see actual conversion examples below:\n\n* https://github.com/yujinakayama/guard/commit/transpec-demo\n* https://github.com/yujinakayama/mail/commit/transpec-demo\n* https://github.com/yujinakayama/twitter/commit/transpec-demo\n\n## Installation\n\nSimply install `transpec` with `gem` command:\n\n```bash\n$ gem install transpec\n```\n\nNormally you don't need to add `transpec` to your `Gemfile` or `*.gemspec` since this isn't a tool to be used daily.\n\n## Basic Usage\n\nBefore converting your specs:\n\n* Make sure your project has `rspec` gem dependency **2.14** or later. If not, change your `Gemfile` or `*.gemspec` to do so.\n* Run `rspec` and check if all the specs pass.\n* Ensure the Git repository is clean. (You don't want to mix up your changes and Transpec's changes, do you?)\n\nThen, run `transpec` in the project root directory:\n\n```bash\n$ cd some-project\n$ transpec\n```\n\nThis will run the specs, convert them, and overwrite all spec files in the `spec` directory.\n\nAfter the conversion, run `rspec` again and check whether everything is still green:\n\n```bash\n$ bundle exec rspec\n```\n\nIf it's green, commit the changes with an auto-generated message\nthat describes the conversion summary and helps your team members to understand the new syntax:\n\n```bash\n$ git commit -aeF .git/COMMIT_EDITMSG\n```\n\nAnd you are done!\n\n## Advanced Usage\n\n### Convert only specific files\n\nYou can pass `transpec` arbitrary paths to convert:\n\n```bash\n# You always need to be in the project root directory\n$ cd some-project\n\n# Convert only files in `features` directory\n$ transpec features\n\n# Convert only files in `spec/foo` and `spec/bar` directory\n$ transpec spec/foo spec/bar\n\n# Convert only `spec/baz_spec.rb`\n$ transpec spec/baz_spec.rb\n```\n\nNote that the current working directory always needs to be the project root directory,\nso that Transpec can know where the root is.\n\n### Enable/disable specific conversions\n\nYou can disable specific conversions that are enabled by default with `-k/--keep` option,\nand enable conversions that are disabled by default with the `-v/--convert` option.\n\nIf you are willing to try the latest and modern syntax, run the following on RSpec 3:\n\n```\n$ transpec --convert example_group,hook_scope\n```\n\nSee [`-k/--keep`](#-k--keep) and [`-v/--convert`](#-v--convert) for more details.\n\n## Options\n\nThough Transpec ships with sensible defaults that essentially conform to the RSpec 3 defaults,\nyou can customize the conversion behavior.\n\n### `-f/--force`\n\nForce processing even if the current Git repository is not clean.\n\n```bash\n$ git status --short\n M spec/spec_helper.rb\n$ transpec\nThe current Git repository is not clean. Aborting. If you want to proceed forcibly, use -f/--force option.\n$ transpec --force\nCopying project for dynamic analysis...\nRunning dynamic analysis with command \"bundle exec rspec\"...\n```\n\n### `-c/--rspec-command`\n\nSpecify a command to run your specs which is used for dynamic analysis.\n\nTranspec needs to run your specs in a copied project directory for dynamic analysis.\nIf your project requires some special setup or commands to run specs, use this option.\n`bundle exec rspec` is used by default.\n\nNote that the command to run dynamic analysis does _not_ affect to the files or specs to be converted.\nThis means that even if you specify a command that only runs a subset of the files in your spec suite or a subset of the specs in a file, every spec will be converted.\nFor this reason, it's recommended to provide a command that runs full spec suite to `-c/--rspec-command`.\nIf you want to convert only a subset of the files in a spec suite, pass the paths to `transpec`.\nSee [Advanced Usage](#advanced-usage) for more details.\n\nYou can change the temporary directory that the your project will be copied\nby specifying the `TMPDIR` environment variable.\n\n```bash\n$ transpec --rspec-command \"./special_setup.sh \u0026\u0026 bundle exec rspec\"\n```\n\n### `-k/--keep`\n\nKeep specific syntaxes by disabling conversions.\n\n```bash\n$ transpec --keep should_receive,stub\n```\n\n#### Conversions enabled by default\n\nNote that some syntaxes are available only if your project's RSpec is specific version or later.\nIf they are unavailable, conversions for such syntaxes will be disabled automatically.\n\nType             | Target Syntax                  | Converted Syntax\n-----------------|--------------------------------|-------------------------------------------\n`should`         | `obj.should matcher`           | `expect(obj).to matcher`\n`oneliner`       | `it { should ... }`            | `it { is_expected.to ... }`\n`should_receive` | `obj.should_receive(:message)` | `expect(obj).to receive(:message)`\n`stub`           | `obj.stub(:message)`           | `allow(obj).to receive(:message)`\n`have_items`     | `expect(obj).to have(n).items` | `expect(obj.size).to eq(n)`\n`its`            | `its(:attr) { }`               | `describe '#attr' { subject { }; it { } }`\n`pending`        | `pending 'is an example' { }`  | `skip 'is an example' { }`\n`deprecated`     | All other deprecated syntaxes  | Latest syntaxes\n\nSee [Supported Conversions](#supported-conversions) for more details.\n\n\n### `-v/--convert`\n\nEnable specific conversions that are disabled by default.\n\n```bash\n$ transpec --convert example_group\n```\n\n#### Conversions disabled by default\n\nMost of these target syntaxes are _not_ deprecated in both RSpec 2 and 3,\nbut the new syntaxes provide more modern and clear ways.\n\nType             | Target Syntax                  | Converted Syntax\n-----------------|--------------------------------|----------------------------------------------------\n`example_group`  | `describe 'something' { }`     | `RSpec.describe 'something' { }`\n`hook_scope`     | `before(:all) { }`             | `before(:context) { }`\n`stub_with_hash` | `obj.stub(:message =\u003e value)`  | `allow(obj).to receive(:message).and_return(value)`\n\nNote: Specifying `stub_with_hash` enables conversion of `obj.stub(:message =\u003e value)`\nto `allow(obj).to receive(:message).and_return(value)`\nwhen `allow(obj).to receive_messages(:message =\u003e value)` is unavailable (prior to RSpec 3.0),\nand it will be converted to multiple statements if the hash includes multiple pairs.\nIf your project's RSpec is 3.0 or later, it will be converted to `receive_messages(:message =\u003e value)`\nregardless of this option.\n\nSee [Supported Conversions - Method stubs with a hash argument](#method-stubs-with-a-hash-argument) for more details.\n\n### `-o/--convert-only`\n\nConvert specific syntaxes while keeping all other syntaxes.\n\nThis option would be useful when you want to convert a non-deprecated syntax\nwhile keeping another syntax that would be converted by default.\n(e.g. converting the hook scope aliases while keeping the one-liner `should`).\n\n```bash\n$ transpec --convert-only example_group,hook_scope\n```\n\n### `-s/--skip-dynamic-analysis`\n\nSkip dynamic analysis and convert with only static analysis.\nThe use of this option is basically **discouraged**\nsince it significantly decreases the overall conversion accuracy.\n\nThis would be useful only if your spec suite takes really long (like an hour) to run\nand you prefer a combination of the rough but fast conversion by Transpec and manual fixes after that.\n\n### `-n/--negative-form`\n\nSpecify a negative form of `to` which is used in the `expect` syntax.\nEither `not_to` or `to_not`.\n`not_to` is used by default.\n\n```bash\n$ transpec --negative-form to_not\n```\n\n### `-b/--boolean-matcher`\n\nSpecify a boolean matcher type which `be_true` and `be_false` will be converted to.\nAny of `truthy,falsey`, `truthy,falsy` or `true,false` can be specified.\n`truthy,falsey` is used by default.\n\n```bash\n$ transpec --boolean-matcher true,false\n```\n\nSee [Supported Conversions - Boolean matchers](#boolean-matchers) for more details.\n\n### `-e/--explicit-spec-type`\n\nAdd explicit spec `:type` metadata to example groups in a project using rspec-rails.\n\nSee [Supported Conversions - Implicit spec types in rspec-rails](#implicit-spec-types-in-rspec-rails) for more details.\n\n### `-a/--no-yield-any-instance`\n\nSuppress yielding receiver instances to `any_instance` implementation blocks as the first block argument.\n\nBy default in RSpec 3, `any_instance` implementation blocks will be yielded the receiving\ninstance as the first block argument, and by default Transpec converts specs by adding instance arguments to the blocks so that they conform to the behavior of RSpec 3.\nSpecifying this option suppresses the conversion and keeps them compatible with RSpec 2.\nNote that this is not same as `--keep deprecated` since this configures `yield_receiver_to_any_instance_implementation_blocks` with `RSpec.configure`.\n\nSee [Supported Conversions - `any_instance` implementation blocks](#any_instance-implementation-blocks) for more details.\n\n### `-p/--no-parens-matcher-arg`\n\nSuppress parenthesizing arguments of matchers when converting\n`should` with operator matcher to `expect` with non-operator matcher\n(the `expect` syntax does not directly support the operator matchers).\nNote that it will be parenthesized even if this option is specified\nwhen parentheses are necessary to keep the meaning of the expression.\n\n```ruby\ndescribe 'original spec' do\n  it 'is an example' do\n    1.should == 1\n    2.should \u003e 1\n    'string'.should =~ /^str/\n    [1, 2, 3].should =~ [2, 1, 3]\n    { key: value }.should == { key: value }\n  end\nend\n\ndescribe 'converted spec' do\n  it 'is an example' do\n    expect(1).to eq(1)\n    expect(2).to be \u003e 1\n    expect('string').to match(/^str/)\n    expect([1, 2, 3]).to match_array([2, 1, 3])\n    expect({ key: value }).to eq({ key: value })\n  end\nend\n\ndescribe 'converted spec with -p/--no-parens-matcher-arg option' do\n  it 'is an example' do\n    expect(1).to eq 1\n    expect(2).to be \u003e 1\n    expect('string').to match /^str/\n    expect([1, 2, 3]).to match_array [2, 1, 3]\n    # With non-operator method, the parentheses are always required\n    # to prevent the hash from being interpreted as a block.\n    expect({ key: value }).to eq({ key: value })\n  end\nend\n```\n\n## Inconvertible Specs\n\nYou might see the following warning while conversion:\n\n```\nCannot convert #should into #expect since #expect is not available in the context.\nspec/awesome_spec.rb:4:      1.should == 1\n```\n\nThis message would be shown with specs like:\n\n```ruby\ndescribe '#should that cannot be converted to #expect' do\n  class MyAwesomeTestRunner\n    def run\n      1.should == 1\n    end\n  end\n\n  it 'is 1' do\n    test_runner = MyAwesomeTestRunner.new\n    test_runner.run\n  end\nend\n```\n\n### Reason\n\n* `should` is defined on `BasicObject` class, so you can use `should` everywhere.\n* `expect` is defined on `RSpec::Matchers` module which is included by `RSpec::Core::ExampleGroup` class, so you can use `expect` only where `self` is an instance of `RSpec::Core::ExampleGroup` (i.e. in `it` blocks, `:each` hook blocks or included module methods) or other classes that explicitly include `RSpec::Matchers`.\n\nWith the above example, in the context of `1.should == 1`, the `self` is an instance of `MyAwesomeTestRunner`.\nTranspec tracks contexts and skips conversion if the syntax cannot be converted in a case like this.\n\n### Solution\n\nInclude or extend any of the following module to make RSpec syntax available in the context:\n\n* `RSpec::Matchers` for `expect(obj).to some_matcher`\n* `RSpec::Mocks::ExampleMethods` for `expect/allow(obj).to receive(:message)`\n\n```ruby\n  class MyAwesomeTestRunner\n    include RSpec::Matchers\n\n    def run\n      1.should == 1\n    end\n  end\n```\n\nThen run `transpec` again.\n\n## Two Types of `should`\n\nThere are two types of `should`:\n\n```ruby\ndescribe 'the monkey-patched should' do\n  subject { [] }\n\n  it 'is empty' do\n    subject.should be_empty\n    #       ^^^^^^ BasicObject#should in RSpec 2.11 or later,\n    #                or Kernel#should prior to RSpec 2.11.\n  end\nend\n\ndescribe 'the one-liner should' do\n  subject { [] }\n\n  it { should be_empty }\n  #    ^^^^^^ RSpec::Core::ExampleGroup#should\nend\n```\n\nThe monkey-patched `obj.should`:\n\n* Is defined on `BasicObject` (or `Kernel`) and provided by `rspec-expectations` gem.\n* Is deprecated in RSpec 3.\n* Has [the issue](http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/#delegation-issues) with delegate/proxy objects.\n* There's the alternative syntax [`expect(obj).to`](#standard-expectations) since RSpec 2.11.\n\nThe one-liner (implicit receiver) `should`:\n\n* Is defined on `RSpec::Core::ExampleGroup` and provided by `rspec-core` gem.\n* Is _not_ deprecated in RSpec 3.\n* Does _not_ have the issue with delegate/proxy objects.\n* There's the alternative syntax [`is_expected.to`](#one-liner-expectations) since RSpec 2.99.beta2.\n\n## Supported Conversions\n\n* [Standard expectations](#standard-expectations)\n* [One-liner expectations](#one-liner-expectations)\n* [Operator matchers](#operator-matchers)\n* [Boolean matchers](#boolean-matchers)\n* [`be_close` matcher](#be_close-matcher)\n* [`have(n).items` matcher](#havenitems-matcher)\n* [One-liner expectations with `have(n).items` matcher](#one-liner-expectations-with-havenitems-matcher)\n* [Expectations on block](#expectations-on-block)\n* [Expectations on attribute of subject with `its`](#expectations-on-attribute-of-subject-with-its)\n* [Negative error expectations with specific error](#negative-error-expectations-with-specific-error)\n* [Message expectations](#message-expectations)\n* [Message expectations that are actually method stubs](#message-expectations-that-are-actually-method-stubs)\n* [Method stubs](#method-stubs)\n* [Method stubs with a hash argument](#method-stubs-with-a-hash-argument)\n* [Method stub aliases](#method-stub-aliases)\n* [Method stubs with deprecated specification of number of times](#method-stubs-with-deprecated-specification-of-number-of-times)\n* [Useless `and_return`](#useless-and_return)\n* [`any_instance` implementation blocks](#any_instance-implementation-blocks)\n* [Test double aliases](#test-double-aliases)\n* [Pending examples](#pending-examples)\n* [Current example object](#current-example-object)\n* [Custom matcher DSL](#custom-matcher-dsl)\n* [Implicit spec types in rspec-rails](#implicit-spec-types-in-rspec-rails)\n* [Deprecated configuration options](#deprecated-configuration-options)\n* [Monkey-patched example groups](#monkey-patched-example-groups)\n* [Hook scope aliases](#hook-scope-aliases)\n\n### Standard expectations\n\nTargets:\n\n```ruby\nobj.should matcher\nobj.should_not matcher\n```\n\nWill be converted to:\n\n```ruby\nexpect(obj).to matcher\nexpect(obj).not_to matcher\nexpect(obj).to_not matcher # with `--negative-form to_not`\n```\n\n* This conversion can be disabled by: `--keep should`\n* Deprecation: deprecated since RSpec 3.0\n* See also: [RSpec's New Expectation Syntax](http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/)\n\n### One-liner expectations\n\nThis conversion is available only if your project's RSpec is **2.99.0.beta2 or later**.\n\nTargets:\n\n```ruby\nit { should matcher }\nit { should_not matcher }\n```\n\nWill be converted to:\n\n```ruby\nit { is_expected.to matcher }\nit { is_expected.not_to matcher }\nit { is_expected.to_not matcher } # with `--negative-form to_not`\n```\n\n`is_expected.to` is designed for the consistency with the `expect` syntax.\nHowever the one-liner `should` is still _not_ deprecated in RSpec 3.0\nand available even if the `should` syntax is\n[disabled with `RSpec.configure`](https://www.relishapp.com/rspec/rspec-expectations/v/3-0/docs/syntax-configuration#disable-should-syntax).\nSo if you think `is_expected.to` is verbose,\nfeel free to disable this conversion and continue using the one-liner `should`.\nSee [Two Types of `should`](#two-types-of-should) also.\n\n* This conversion can be disabled by: `--keep oneliner`\n* Deprecation: not deprecated\n* See also: [Add `is_expected` for expect-based one-liner syntax. by myronmarston · rspec/rspec-core](https://github.com/rspec/rspec-core/pull/1180)\n\n### Operator matchers\n\nTargets:\n\n```ruby\n1.should == 1\n1.should \u003c 2\nInteger.should === 1\n'string'.should =~ /^str/\n[1, 2, 3].should =~ [2, 1, 3]\n```\n\nWill be converted to:\n\n```ruby\nexpect(1).to eq(1)\nexpect(1).to be \u003c 2\nexpect(Integer).to be === 1\nexpect('string').to match(/^str/)\nexpect([1, 2, 3]).to match_array([2, 1, 3])\n```\n\nThis conversion is combined with the conversion of [standard expectations](#standard-expecatations) and cannot be disabled separately because the `expect` syntax does not directly support the operator matchers.\n\n* See also: [(Almost) All Matchers Are Supported - RSpec's New Expectation Syntax](http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/#almost-all-matchers-are-supported)\n\n### Boolean matchers\n\nThis conversion is available only if your project's RSpec is **2.99.0.beta1 or later**.\n\nTargets:\n\n```ruby\nexpect(obj).to be_true\nexpect(obj).to be_false\n```\n\nWill be converted to:\n\n```ruby\nexpect(obj).to be_truthy\nexpect(obj).to be_falsey\n\n# With `--boolean-matcher truthy,falsy`\n# be_falsy is just an alias of be_falsey.\nexpect(obj).to be_truthy\nexpect(obj).to be_falsy\n\n# With `--boolean-matcher true,false`\nexpect(obj).to be true\nexpect(obj).to be false\n```\n\n* `be_true` matcher passes if expectation subject is _truthy_ in conditional semantics. (i.e. all objects except `false` and `nil`)\n* `be_false` matcher passes if expectation subject is _falsey_ in conditional semantics. (i.e. `false` or `nil`)\n* `be_truthy` and `be_falsey` matchers are renamed version of `be_true` and `be_false` and their behaviors are same.\n* `be true` and `be false` are not new things. These are combinations of `be` matcher and boolean literals. These pass if expectation subject is exactly equal to boolean value.\n\nSo, converting `be_true`/`be_false` to `be_truthy`/`be_falsey` never breaks your specs and this is Transpec's default. If you are willing to test boolean values strictly, you can convert them to `be true`/`be false` with `--boolean-matcher true,false` option. Note that this may break your specs if your application code don't return exact boolean values.\n\n* This conversion can be disabled by: `--keep deprecated`\n* Deprecation: deprecated since RSpec 2.99, removed in RSpec 3.0\n* See also: [Consider renaming `be_true` and `be_false` to `be_truthy` and `be_falsey` · rspec/rspec-expectations](https://github.com/rspec/rspec-expectations/issues/283)\n\n### `be_close` matcher\n\nTargets:\n\n```ruby\nexpect(1.0 / 3.0).to be_close(0.333, 0.001)\n```\n\nWill be converted to:\n\n```ruby\nexpect(1.0 / 3.0).to be_within(0.001).of(0.333)\n```\n\n* This conversion can be disabled by: `--keep deprecated`\n* Deprecation: deprecated since RSpec 2.1, removed in RSpec 3.0\n* See also: [New be within matcher and RSpec.deprecate fix · rspec/rspec-expectations](https://github.com/rspec/rspec-expectations/pull/32)\n\n### `have(n).items` matcher\n\nThis conversion will be **disabled automatically if `rspec-collection_matchers` is loaded** in your spec.\n\nTargets:\n\n```ruby\nexpect(collection).to have(3).items\nexpect(collection).to have_exactly(3).items\nexpect(collection).to have_at_least(3).items\nexpect(collection).to have_at_most(3).items\n\ncollection.should have(3).items\n\n# Assume `team` responds to #players.\nexpect(team).to have(3).players\n\n# Assume #players is a private method.\nexpect(team).to have(3).players\n\n# Validation expectations in rspec-rails.\nexpect(model).to have(2).errors_on(:name)\n```\n\nWill be converted to:\n\n```ruby\nexpect(collection.size).to eq(3)\nexpect(collection.size).to eq(3)\nexpect(collection.size).to be \u003e= 3\nexpect(collection.size).to be \u003c= 3\n\n # With `--keep should`\ncollection.size.should == 3\n\nexpect(team.players.size).to eq(3)\n\n# have(n).items matcher invokes #players even if it's a private method.\nexpect(team.send(:players).size).to eq(3)\n\n# Conversion of `have(n).errors_on(:attr)` is not supported.\nexpect(model).to have(2).errors_on(:name)\n```\n\nThere's an option to continue using `have(n).items` matcher with [rspec-collection_matchers](https://github.com/rspec/rspec-collection_matchers) which is a gem extracted from `rspec-expectations`.\nIf you choose to do so, disable this conversion by either:\n\n* Specify `--keep have_items` option manually.\n* Require `rspec-collection_matchers` in your spec so that Transpec automatically disables this conversion.\n\n#### Note about `expect(model).to have(n).errors_on(:attr)`\n\nThe idiom `expect(model).to have(n).errors_on(:attr)` in rspec-rails 2 consists of\n`have(n).items` matcher and a monkey-patch [`ActiveModel::Validations#errors_on`](https://github.com/rspec/rspec-rails/blob/v2.14.2/lib/rspec/rails/extensions/active_record/base.rb#L34-L57).\nIn RSpec 2 the monkey-patch was provided by rspec-rails,\nbut in RSpec 3 it's extracted to rspec-collection_matchers along with `have(n).items` matcher.\nSo if you convert it to `expect(model.errors_on(:attr).size).to eq(2)` without rspec-collection_matchers,\nit fails with error `undefined method 'error_on' for #\u003cModel ...\u003e`.\n\nTechnically it can be converted to:\n\n```ruby\nmodel.valid?\nexpect(model.errors[:attr].size).to eq(n)\n```\n\nHowever currently Transpec doesn't support this conversion\nsince this is probably not what most people want.\nSo using rspec-collection_matchers gem is recommended for now.\n\n* This conversion can be disabled by: `--keep have_items`\n* Deprecation: deprecated since RSpec 2.99, removed in RSpec 3.0\n* See also: [Expectations: `have(x).items` matchers will be moved into an external gem - The Plan for RSpec 3](http://rspec.info/blog/2013/07/the-plan-for-rspec-3/#expectations-havexitems-matchers-will-be-moved-into-an-external-gem)\n\n### One-liner expectations with `have(n).items` matcher\n\nThis conversion will be **disabled automatically if `rspec-collection_matchers` is loaded** in your spec.\n\nTargets:\n\n```ruby\nit { should have(3).items }\nit { should have_at_least(3).players }\n```\n\nWill be converted to:\n\n```ruby\nit 'has 3 items' do\n  expect(subject.size).to eq(3)\nend\n\n# With `--keep should`\nit 'has 3 items' do\n  subject.size.should == 3\nend\n\nit 'has at least 3 players' do\n  expect(subject.players.size).to be \u003e= 3\nend\n```\n\n* This conversion can be disabled by: `--keep have_items`\n\n### Expectations on block\n\nTargets:\n\n```ruby\nlambda { do_something }.should raise_error\nproc { do_something }.should raise_error\n-\u003e { do_something }.should raise_error\nexpect { do_something }.should raise_error\n```\n\nWill be converted to:\n\n```ruby\nexpect { do_something }.to raise_error\n```\n\n* This conversion can be disabled by: `--keep should`\n* Deprecation: deprecated since RSpec 3.0\n* See also: [Unification of Block vs. Value Syntaxes - RSpec's New Expectation Syntax](http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/#unification-of-block-vs-value-syntaxes)\n\n### Expectations on attribute of subject with `its`\n\nThis conversion will be **disabled automatically if `rspec-its` is loaded** in your spec.\n\nTargets:\n\n```ruby\ndescribe 'example' do\n  subject { { foo: 1, bar: 2 } }\n  its(:size) { should == 2 }\n  its([:foo]) { should == 1 }\n  its('keys.first') { should == :foo }\nend\n```\n\nWill be converted to:\n\n```ruby\ndescribe 'example' do\n  subject { { foo: 1, bar: 2 } }\n\n  describe '#size' do\n    subject { super().size }\n    it { should == 2 }\n  end\n\n  describe '[:foo]' do\n    subject { super()[:foo] }\n    it { should == 1 }\n  end\n\n  describe '#keys' do\n    subject { super().keys }\n    describe '#first' do\n      subject { super().first }\n      it { should == :foo }\n    end\n  end\nend\n```\n\nThere's an option to continue using `its` with [rspec-its](https://github.com/rspec/rspec-its) which is a gem extracted from `rspec-core`.\nIf you choose to do so, disable this conversion by either:\n\n* Specify `--keep its` option manually.\n* Require `rspec-its` in your spec so that Transpec automatically disables this conversion.\n\nNote that this conversion is a sort of first-aid\nand ideally the expectations should be rewritten to be more expressive by yourself.\nRead [this post](https://gist.github.com/myronmarston/4503509) for the rationale.\n\n* This conversion can be disabled by: `--keep its`\n* Deprecation: deprecated since RSpec 2.99, removed in RSpec 3.0\n* See also: [Core: `its` will be moved into an external gem - The Plan for RSpec 3](http://rspec.info/blog/2013/07/the-plan-for-rspec-3/#core-its-will-be-moved-into-an-external-gem)\n\n### Negative error expectations with specific error\n\nTargets:\n\n```ruby\nexpect { do_something }.not_to raise_error(SomeErrorClass)\nexpect { do_something }.not_to raise_error('message')\nexpect { do_something }.not_to raise_error(SomeErrorClass, 'message')\nlambda { do_something }.should_not raise_error(SomeErrorClass)\n```\n\nWill be converted to:\n\n```ruby\nexpect { do_something }.not_to raise_error\nlambda { do_something }.should_not raise_error # with `--keep should`\n```\n\n* This conversion can be disabled by: `--keep deprecated`\n* Deprecation: deprecated since RSpec 2.14, removed in RSpec 3.0\n* See also: [Consider deprecating `expect { }.not_to raise_error(SpecificErrorClass)` · rspec/rspec-expectations](https://github.com/rspec/rspec-expectations/issues/231)\n\n### Message expectations\n\nTargets:\n\n```ruby\nobj.should_receive(:message)\nKlass.any_instance.should_receive(:message)\n```\n\nWill be converted to:\n\n```ruby\nexpect(obj).to receive(:message)\nexpect_any_instance_of(Klass).to receive(:message)\n```\n\n* This conversion can be disabled by: `--keep should_receive`\n* Deprecation: deprecated since RSpec 3.0\n* See also: [RSpec's new message expectation syntax](http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/)\n\n### Message expectations that are actually method stubs\n\nTargets:\n\n```ruby\nobj.should_receive(:message).any_number_of_times\nobj.should_receive(:message).at_least(0)\n\nKlass.any_instance.should_receive(:message).any_number_of_times\nKlass.any_instance.should_receive(:message).at_least(0)\n```\n\nWill be converted to:\n\n```ruby\nallow(obj).to receive(:message)\nobj.stub(:message) # with `--keep stub`\n\nallow_any_instance_of(Klass).to receive(:message)\nKlass.any_instance.stub(:message) # with `--keep stub`\n```\n\n* This conversion can be disabled by: `--keep deprecated`\n* Deprecation: deprecated since RSpec 2.14, removed in RSpec 3.0\n* See also: [Don't allow at_least(0) · rspec/rspec-mocks](https://github.com/rspec/rspec-mocks/issues/133)\n\n### Method stubs\n\nTargets:\n\n```ruby\nobj.stub(:message)\nobj.stub!(:message)\n\nobj.stub_chain(:foo, :bar, :baz)\n\nKlass.any_instance.stub(:message)\n\nobj.unstub(:message)\nobj.unstub!(:message)\n```\n\nWill be converted to:\n\n```ruby\nallow(obj).to receive(:message)\n\n# Conversion from `stub_chain` to `receive_message_chain` is available\n# only if the target project's RSpec is 3.0.0.beta2 or later\nallow(obj).to receive_message_chain(:foo, :bar, :baz)\n\nallow_any_instance_of(Klass).to receive(:message)\n\nallow(obj).to receive(:message).and_call_original\n```\n\n* This conversion can be disabled by: `--keep stub`\n* Deprecation: deprecated since RSpec 3.0\n* See also:\n    * [RSpec's new message expectation syntax](http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/)\n    * [Bring back stub_chain (receive_message_chain) · rspec/rspec-mocks](https://github.com/rspec/rspec-mocks/issues/464)\n\n### Method stubs with a hash argument\n\nTargets:\n\n```ruby\nobj.stub(:foo =\u003e 1, :bar =\u003e 2)\n```\n\nWill be converted to:\n\n```ruby\n# If the target project's RSpec is 3.0.0.beta1 or later\nallow(obj).to receive_messages(:foo =\u003e 1, :bar =\u003e 2)\n\n# If the target project's RSpec is prior to 3.0.0.beta1\nobj.stub(:foo =\u003e 1, :bar =\u003e 2) # No conversion\n\n# If the target project's RSpec is prior to 3.0.0.beta1\n# and `--convert stub-with-hash` is specified\nallow(obj).to receive(:foo).and_return(1)\nallow(obj).to receive(:bar).and_return(2)\n```\n\n`allow(obj).to receive_messages(:foo =\u003e 1, :bar =\u003e 2)` which is designed to be the replacement for `obj.stub(:foo =\u003e 1, :bar =\u003e 2)` is available from RSpec 3.0.\n\nSo, if you're going to use Transpec in [the upgrade path to RSpec 3](http://rspec.info/blog/2013/07/the-plan-for-rspec-3/#the-upgrade-path), you may need to follow these steps:\n\n1. Upgrade to RSpec 2.99\n2. Run `transpec` (at this time `obj.stub(:message =\u003e value)` won't be converted)\n3. Upgrade to RSpec 3.0\n4. Run `transpec` again to convert `obj.stub(:message =\u003e value)`\n\nOr if you're going to stay RSpec 2.14 for now but want to convert all `stub` to `allow` statements, run `transpec` with `--convert stub_with_hash` option. Note that once the conversion is done, multiple statements cannot be merged into a `receive_messages`.\n\n* This conversion can be disabled by: `--keep stub`\n* Deprecation: deprecated since RSpec 3.0\n* See also: [allow receive with multiple methods · rspec/rspec-mocks](https://github.com/rspec/rspec-mocks/issues/368)\n\n### Method stub aliases\n\nTargets:\n\n```ruby\nobj.stub!(:message)\nobj.unstub!(:message)\n```\n\nWill be converted to:\n\n```ruby\n# With `--keep stub`\nobj.stub(:message)\nobj.unstub(:message)\n```\n\n* This conversion can be disabled by: `--keep deprecated`\n* Deprecation: deprecated since RSpec 2.14, removed in RSpec 3.0\n* See also: [Consider deprecating and/or removing #stub! and #unstub! at some point · rspec/rspec-mocks](https://github.com/rspec/rspec-mocks/issues/122)\n\n### Method stubs with deprecated specification of number of times\n\nTargets:\n\n```ruby\nobj.stub(:message).any_number_of_times\nobj.stub(:message).at_least(0)\n```\n\nWill be converted to:\n\n```ruby\nallow(obj).to receive(:message)\nobj.stub(:message) # with `--keep stub`\n```\n\n* This conversion can be disabled by: `--keep deprecated`\n* Deprecation: deprecated since RSpec 2.14, removed in RSpec 3.0\n* See also: [Don't allow at_least(0) · rspec/rspec-mocks](https://github.com/rspec/rspec-mocks/issues/133)\n\n### Useless `and_return`\n\nTargets:\n\n```ruby\nexpect(obj).to receive(:message).and_return { 1 }\nallow(obj).to receive(:message).and_return { 1 }\n\nexpect(obj).to receive(:message).and_return\nallow(obj).to receive(:message).and_return\n```\n\nWill be converted to:\n\n```ruby\nexpect(obj).to receive(:message) { 1 }\nallow(obj).to receive(:message) { 1 }\n\nexpect(obj).to receive(:message)\nallow(obj).to receive(:message)\n```\n\n* This conversion can be disabled by: `--keep deprecated`\n* Deprecation: deprecated since RSpec 2.99, removed in RSpec 3.0\n* See also: [Consider deprecating `and_return { value }` · rspec/rspec-mocks](https://github.com/rspec/rspec-mocks/issues/558)\n\n### `any_instance` implementation blocks\n\nThis conversion is available only if your project's RSpec is **`\u003e= 2.99.0.beta1` and `\u003c 3.0.0.beta1`**.\n\nTargets:\n\n```ruby\nRSpec.configure do |rspec|\nend\n\ndescribe 'example' do\n  it 'is any_instance implementation block' do\n    expect_any_instance_of(Klass).to receive(:message) { |arg| puts arg }\n    allow_any_instance_of(Klass).to receive(:message) { |arg| puts arg }\n  end\nend\n```\n\nWill be converted to:\n\n```ruby\nRSpec.configure do |rspec|\n  rspec.mock_with :rspec do |mocks|\n    # In RSpec 3, `any_instance` implementation blocks will be yielded the receiving\n    # instance as the first block argument to allow the implementation block to use\n    # the state of the receiver.\n    # In RSpec 2.99, to maintain compatibility with RSpec 3 you need to either set\n    # this config option to `false` OR set this to `true` and update your\n    # `any_instance` implementation blocks to account for the first block argument\n    # being the receiving instance.\n    mocks.yield_receiver_to_any_instance_implementation_blocks = true\n  end\nend\n\ndescribe 'example' do\n  it 'is any_instance implementation block' do\n    expect_any_instance_of(Klass).to receive(:message) { |instance, arg| puts arg }\n    allow_any_instance_of(Klass).to receive(:message) { |instance, arg| puts arg }\n  end\nend\n```\n\nOr with `--no-yield-any-instance` option they will be converted to:\n\n```ruby\nRSpec.configure do |rspec|\n  rspec.mock_with :rspec do |mocks|\n    # In RSpec 3, `any_instance` implementation blocks will be yielded the receiving\n    # instance as the first block argument to allow the implementation block to use\n    # the state of the receiver.\n    # In RSpec 2.99, to maintain compatibility with RSpec 3 you need to either set\n    # this config option to `false` OR set this to `true` and update your\n    # `any_instance` implementation blocks to account for the first block argument\n    # being the receiving instance.\n    mocks.yield_receiver_to_any_instance_implementation_blocks = false\n  end\nend\n\ndescribe 'example' do\n  it 'is any_instance implementation block' do\n    expect_any_instance_of(Klass).to receive(:message) { |arg| puts arg }\n    allow_any_instance_of(Klass).to receive(:message) { |arg| puts arg }\n  end\nend\n```\n\n* This conversion can be disabled by: `--keep deprecated`\n* Deprecation: deprecated since RSpec 2.99\n* See also: [Mocks: `any_instance` block implementations will yield the receiver](http://rspec.info/blog/2013/07/the-plan-for-rspec-3/#mocks-anyinstance-block-implementations-will-yield-the-receiver)\n\n### Test double aliases\n\nTargets:\n\n```ruby\nstub('something')\nmock('something')\n```\n\nWill be converted to:\n\n```ruby\ndouble('something')\n```\n\n* This conversion can be disabled by: `--keep deprecated`\n* Deprecation: deprecated since RSpec 2.14, removed in RSpec 3.0\n* See also: [myronmarston / why_double.md - Gist](https://gist.github.com/myronmarston/6576665)\n\n### Pending examples\n\nThis conversion is available only if your project's RSpec is **`\u003e= 2.99.0.beta1` and `\u003c 3.0.0.beta1`**.\n\nTargets:\n\n```ruby\ndescribe 'example' do\n  it 'is skipped', :pending =\u003e true do\n    do_something_possibly_fail # This won't be run\n  end\n\n  pending 'is skipped' do\n    do_something_possibly_fail # This won't be run\n  end\n\n  it 'is skipped' do\n    pending\n    do_something_possibly_fail # This won't be run\n  end\n\n  it 'is run and expected to fail' do\n    pending do\n      do_something_surely_fail # This will be run and expected to fail\n    end\n  end\nend\n```\n\nWill be converted to:\n\n```ruby\ndescribe 'example' do\n  it 'is skipped', :skip =\u003e true do\n    do_something_possibly_fail # This won't be run\n  end\n\n  skip 'is skipped' do\n    do_something_possibly_fail # This won't be run\n  end\n\n  it 'is skipped' do\n    skip\n    do_something_possibly_fail # This won't be run\n  end\n\n  it 'is run and expected to fail' do\n    pending # #pending with block is no longer supported\n    do_something_surely_fail # This will be run and expected to fail\n  end\nend\n```\n\nHere's an excerpt from [the warning](https://github.com/rspec/rspec-core/blob/v2.99.0.beta2/lib/rspec/core/example_group.rb#L67-L75) for pending examples in RSpec 2.99:\n\n\u003e The semantics of `RSpec::Core::ExampleGroup#pending` are changing in RSpec 3.\n\u003e In RSpec 2.x, it caused the example to be skipped. In RSpec 3, the example will\n\u003e still be run but is expected to fail, and will be marked as a failure (rather\n\u003e than as pending) if the example passes, just like how `pending` with a block\n\u003e from within an example already works.\n\u003e\n\u003e To keep the same skip semantics, change `pending` to `skip`.  Otherwise, if you\n\u003e want the new RSpec 3 behavior, you can safely ignore this warning and continue\n\u003e to upgrade to RSpec 3 without addressing it.\n\n* This conversion can be disabled by: `--keep pending`\n* Deprecation: not deprecated but the behavior changes in RSpec 3.0\n* See also: [Feature request: shortcut for pending-block within it · rspec/rspec-core](https://github.com/rspec/rspec-core/issues/1208)\n\n### Current example object\n\nThis conversion is available only if your project's RSpec is **2.99.0.beta1 or later**.\n\nTargets:\n\n```ruby\nmodule ScreenshotHelper\n  def save_failure_screenshot\n    return unless example.exception\n    # ...\n  end\nend\n\ndescribe 'example page' do\n  include ScreenshotHelper\n  after { save_failure_screenshot }\n  let(:user) { User.find(example.metadata[:user_id]) }\n  # ...\nend\n```\n\nWill be converted to:\n\n```ruby\nmodule ScreenshotHelper\n  def save_failure_screenshot\n    return unless RSpec.current_example.exception\n    # ...\n  end\nend\n\ndescribe 'example page' do\n  include ScreenshotHelper\n  after { save_failure_screenshot }\n  let(:user) { |example| User.find(example.metadata[:user_id]) }\n  # ...\nend\n```\n\nHere's an excerpt from [the warning](https://github.com/rspec/rspec-core/blob/7d6d2ca/lib/rspec/core/example_group.rb#L513-L527) for `RSpec::Core::ExampleGroup#example` and `#running_example` in RSpec 2.99:\n\n\u003e `RSpec::Core::ExampleGroup#example` is deprecated and will be removed in RSpec 3. There are a few options for what you can use instead:\n\u003e\n\u003e - `rspec-core`'s DSL methods (`it`, `before`, `after`, `let`, `subject`, etc) now yield the example as a block argument, and that is the recommended way to access the current example from those contexts.\n\u003e - The current example is now exposed via `RSpec.current_example`, which is accessible from any context.\n\u003e - If you can't update the code at this call site (e.g. because it is in an extension gem), you can use this snippet to continue making this method available in RSpec 2.99 and RSpec 3:\n\u003e\n\u003e ```ruby\n\u003e RSpec.configure do |c|\n\u003e   c.expose_current_running_example_as :example\n\u003e end\n\u003e ```\n\n* This conversion can be disabled by: `--keep deprecated`\n* Deprecation: deprecated since RSpec 2.99, removed in RSpec 3.0\n* See also: [Core: DSL methods will yield the example - The Plan for RSpec 3](http://rspec.info/blog/2013/07/the-plan-for-rspec-3/#core-dsl-methods-will-yield-the-example)\n\n### Custom matcher DSL\n\nThis conversion is available only if your project's RSpec is **3.0.0.beta2 or later**.\n\nTargets:\n\n```ruby\nRSpec::Matchers.define :be_awesome do\n  match_for_should { }\n  match_for_should_not { }\n  failure_message_for_should { }\n  failure_message_for_should_not { }\nend\n```\n\nWill be converted to:\n\n```ruby\nRSpec::Matchers.define :be_awesome do\n  match { }\n  match_when_negated { }\n  failure_message { }\n  failure_message_when_negated { }\nend\n```\n\n* This conversion can be disabled by: `--keep deprecated`\n* Deprecation: deprecated since RSpec 3.0\n* See also: [Expectations: Matcher protocol and custom matcher API changes - The Plan for RSpec 3](http://rspec.info/blog/2013/07/the-plan-for-rspec-3/#expectations-matcher-protocol-and-custom-matcher-api-changes)\n\n### Implicit spec types in rspec-rails\n\nThis conversion is **available only if `rspec-rails` is loaded** in your spec and your project's RSpec is **2.99.0.rc1 or later**.\n\nTargets:\n\n```ruby\n# In spec/models/some_model_spec.rb\nRSpec.configure do |rspec|\nend\n\ndescribe SomeModel do\nend\n```\n\nWill be converted to:\n\n```ruby\nRSpec.configure do |rspec|\n  # rspec-rails 3 will no longer automatically infer an example group's spec type\n  # from the file location. You can explicitly opt-in to the feature using this\n  # config option.\n  # To explicitly tag specs without using automatic inference, set the `:type`\n  # metadata manually:\n  #\n  #     describe ThingsController, :type =\u003e :controller do\n  #       # Equivalent to being in spec/controllers\n  #     end\n  rspec.infer_spec_type_from_file_location!\nend\n\ndescribe SomeModel do\nend\n```\n\nOr with `--explicit-spec-type` option they will be converted to:\n\n```ruby\nRSpec.configure do |rspec|\nend\n\ndescribe SomeModel, :type =\u003e :model do\nend\n```\n\n* This conversion can be disabled by: `--keep deprecated`\n* Deprecation: deprecated since RSpec 2.99, removed in RSpec 3.0\n* See also: [Consider making example group mixins more explicit · rspec/rspec-rails](https://github.com/rspec/rspec-rails/issues/662)\n\n### Deprecated configuration options\n\nTargets:\n\n```ruby\nRSpec.configure do |c|\n  c.backtrace_clean_patterns\n  c.backtrace_clean_patterns = [/lib\\/something/]\n  c.color_enabled = true\n\n  c.out\n  c.out = File.open('output.txt', 'w')\n  c.output\n  c.output = File.open('output.txt', 'w')\n\n  c.backtrace_cleaner\n  c.color?(output)\n  c.filename_pattern\n  c.filename_pattern = '**/*_test.rb'\n  c.warnings\nend\n```\n\nWill be converted to:\n\n```ruby\nRSpec.configure do |c|\n  c.backtrace_exclusion_patterns\n  c.backtrace_exclusion_patterns = [/lib\\/something/]\n  c.color = true\n\n  # RSpec 2.99.0.beta1 or later\n  c.output_stream\n  c.output_stream = File.open('output.txt', 'w')\n  c.output_stream\n  c.output_stream = File.open('output.txt', 'w')\n\n  # RSpec 2.99.0.rc1 or later\n  c.backtrace_formatter\n  c.color_enabled?(output)\n  c.pattern\n  c.pattern = '**/*_test.rb'\n  c.warnings?\nend\n```\n\n* This conversion can be disabled by: `--keep deprecated`\n\n### Monkey-patched example groups\n\nThis conversion is **disabled by default** and available only if your project's RSpec is **3.0.0.beta2 or later**.\n\nTargets:\n\n```ruby\nRSpec.configure do |rspec|\nend\n\ndescribe 'top-level example group' do\n  describe 'nested example group' do\n  end\nend\n\nshared_examples 'shared examples' do\nend\n```\n\nWill be converted to:\n\n```ruby\nRSpec.configure do |rspec|\n  # Setting this config option `false` removes rspec-core's monkey patching of the\n  # top level methods like `describe`, `shared_examples_for` and `shared_context`\n  # on `main` and `Module`. The methods are always available through the `RSpec`\n  # module like `RSpec.describe` regardless of this setting.\n  # For backwards compatibility this defaults to `true`.\n  #\n  # https://relishapp.com/rspec/rspec-core/v/3-0/docs/configuration/global-namespace-dsl\n  rspec.expose_dsl_globally = false\nend\n\nRSpec.describe 'top-level example group' do\n  describe 'nested example group' do\n  end\nend\n\nRSpec.shared_examples 'shared examples' do\nend\n```\n\n* This conversion can be enabled by: `--convert example_group`\n* Deprecation: not deprecated\n* See also: [Zero Monkey Patching Mode! - The Plan for RSpec 3](http://rspec.info/blog/2013/07/the-plan-for-rspec-3/#zero-monkey-patching-mode)\n\n### Hook scope aliases\n\nThis conversion is **disabled by default** and available only if your project's RSpec is **3.0.0.beta2 or later**.\n\nTargets:\n\n```ruby\ndescribe 'example' do\n  before { do_something }\n  before(:each) { do_something }\n  before(:all) { do_something }\nend\n\nRSpec.configure do |rspec|\n  rspec.before(:suite) { do_something }\nend\n```\n\nWill be converted to:\n\n```ruby\ndescribe 'example' do\n  before { do_something }\n  before(:example) { do_something }\n  before(:context) { do_something }\nend\n\nRSpec.configure do |rspec|\n  rspec.before(:suite) { do_something }\nend\n```\n\n* This conversion can be enabled by: `--convert hook_scope`\n* Deprecation: not deprecated\n* See also: [Adds hook scope aliases `example` and `context` · rspec/rspec-core](https://github.com/rspec/rspec-core/pull/1174)\n\n## Compatibility\n\nTranspec is tested on the following Ruby implementations:\n\n* MRI 2.0.0\n* MRI 2.2.10\n* MRI 2.4.6\n* MRI 2.6.3\n* JRuby 9.2.7.0\n\n## License\n\nCopyright (c) 2013–2020 Yuji Nakayama\n\nSee the [LICENSE.txt](LICENSE.txt) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyujinakayama%2Ftranspec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyujinakayama%2Ftranspec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyujinakayama%2Ftranspec/lists"}