- Drop support for Ruby 1.9.3.
- Use
parser
gem 2.5.0.0 or later. - Handle deprecation message
Parser::Source::Rewriter is deprecated.
fromparser
gem.
- Support
json
gem 2.x andactivesupport
gem 5.x.
- Use
parser
gem 2.3.0.7 or later.
- Pin
parser
gem to 2.3.0.2 temporarily so that dynamic analysis works properly.
- Support Ruby 2.3 syntax.
- Avoid converting invalid
have
matcher withoutitems
part. (#108)
- Support conversion of
have(:no).items
andhave('2').items
. (#107)
- Add
-o/--convert-only
option for converting specific syntaxes while keeping all other syntaxes. (#91)
- Fix error on converting spec with AWS.stub! without dynamic analysis. (#100)
- Include problematic file path in error message of failure on project copy. (#96)
- Bump
parser
dependency to~> 2.2
along with the release of MRI 2.2.
- Abort processing if the project has a
Gemfile
but noGemfile.lock
.
- Fix an issue where
obj = Klass.any_instance; obj.should_receive(:message)
was not properly converted toexpect_any_instance_of(Klass).to receive(:message)
when run on RSpec 3. - Improve the static context inspection accuracy when run on RSpec 3.
- Check target project's RSpec version via
Gemfile.lock
instead of runningrspec --version
.
- Fix a bug where
obj.should =~ an_activerecord_relation
was converted toexpect(obj).to match(an_activerecord_relation)
rather thanmatch_array
. (#92)
- Fix a bug where
have(n).errors_on(:attr)
was unintentionally converted when combined with one-linershould
. (#95)
- Exclude spec files from the gem package to lighten the package size.
- Check whether rspec-rails is used in the target project via
Gemfile.lock
when-s/--skip-dynamic-analysis
option is specified. (#88) - Now by default the addition of
config.infer_spec_type_from_file_location!
is enabled and the addition of explicit:type
metadata to each example group is disabled in a project usingrspec-rails
(the former behavior with-t/--no-explicit-spec-type
). - Remove
-t/--no-explicit-spec-type
and add-e/--explicit-spec-type
option. - Handle separated git-dir repository on generation of the commit message. (#94)
- Fix an error on processing one-liner
should
that is not directly enclosed in an example block. (#93)
- Fix a bug where nested example groups in
RSpec.describe
are wrongly converted to non-monkey-patch form when dynamic analysis is skipped. (#89)
- Fix error
Unresolved dependency found during sorting - parser
ongem install transpec
.
- Avoid crash on processing invalid encoding source files and warn of the encoding errors. (#81)
- Detect whether RSpec configuration
config.raise_errors_for_deprecations!
which interferes with Transpec's dynamic analysis is enabled in the user's specs and abort processing if so. (#80)
- Fix failure on dynamic analysis when there's a RSpec-like method invocation in a context that undefines
Object
methods (e.g.after
callback in factory_girl definition context). (#66)
- Fix a bug where explicit spec type metadata are added to wrong position when the
describe
has multiple non-metadata arguments (e.g.describe Something, '#some_method' { }
). (#77)
- Remove conversion support for non-existent configuration option
backtrace_cleaner=
. - Add missing way to disable conversion of deprecated configuration options with
--keep deprecated
.
- Report configuration modifications of
RSpec.configure
in the final summary. - Support conversion of configuration options
backtrace_clean_patterns
,backtrace_clean_patterns=
,color_enabled=
,output
,output=
,out
,out=
,filename_pattern
,filename_pattern=
,backtrace_cleaner
,backtrace_cleaner=
,color?
andwarnings
.
- Fix invalid conversion of
unstub
without parentheses (obj.unstub :message
). (#74)
- Avoid crash on invalid
expect
syntax expectations (e.g.expect(obj)
without followingto
orexpect(obj).to
taking no matcher). (#71)
- Handle
its(:attr) { should have(n).items }
. (#68)
- Fix error on dynamic analysis when the project have
.rspec
file containing some--require
options and the required file contains some RSpec API.
- Fix invalid conversion of
pending
with block including an empty line.
- Add descriptive comments to auto-added configurations in
RSpec.configure
. - Deprecate
--no-parentheses-matcher-arg
option in favor of--no-parens-matcher-arg
. - Remove consecutive white spaces between
its
and the block.
- Disable invalid conversion of
expect(model).to have(n).errors_on(:attr)
. (#62) - Fix false positive conversion of
expect { }.should raise_error(SpecificErrorClass)
. (#64) - Support conversion of
expect { do_something }.should
. - Relax
activesupport
dependency from'~> 4.0'
to'>= 3.0', '< 5.0'
in case thattranspec
is added to aGemfile
. (#63)
- Support conversion of implicit spec types in rspec-rails. (#57)
- Enable conversion of
have(n).items
even if rspec-rails is loaded in the spec according to the removal of rspec-collection_matchers in rspec-rails 3. - Remove support for deprecated options
-m/--generate-commit-message
and-t/--convert-stub-with-hash
.
- Fix a bug where multiline expression
expect(obj).to receive(:message)\n.and_return { value }
was converted toexpect(obj).to.receive(:message)\n { value }
and the block was interpreted as a hash literal. (#60) - Fix a bug where dynamic analysis were not run partially when there are same structure nodes in an AST with
ast
gem 2.0.
- Improve the conversion performance.
- Support conversion of hook scope names. (#53)
- Add missing description of
example_group
for-v/--convert
option in the-h/--help
text.
- Support conversion to non-monkey-patch example groups. (#22)
- Support conversion of
unstub
. (#49) - Modify
yield_receiver_to_any_instance_implementation_blocks
configuration inRSpec.configure
only when necessary. (#56) - Modify only the main
RSpec.configure
when there are multiple ones. (#56) - Add
-v/--convert
option that allows to enable conversions that are disabled by default. - Deprecate
-t/--convert-stub-with-hash
option.
- Avoid confusing methods defined with
#let
or#subject
by user with RSpec built-in methods. (#55) - Add experimental support for Ruby 2.2 (development version) by falling back to Ruby 2.1 parser.
- Suggest using
-c/--rspec-command
option and exit gracefully when dynamic analysis failed. (#52)
- Fix a bug where
expect(an_array + another_array).to have(2).items
was converted toexpect(an_array +(another_array).size).to eq(2)
.
- Fix a bug where
expect.(hash['some_key']).to have(2).items
was converted toexpect(hash[().size).to eq(2)
(#51)
- Support conversion of pending examples.
- Display cautions for less-accurate conversions caused by a lack of runtime information. (#42)
- Handle
variable.any_instance
. (#46) - Fix a bug where the DSL
example
. (an alias ofit
) was confused with current example object (e.g.example 'it does something' do ... end
was converted toexample 'it does something' do |example| ... end
)
- Fix a bug where
expect.(method_returns_collection :some_arg).to have(2).items
was converted toexpect(method_returns_collection :some_arg.size).to eq(2)
(#43) - Fix false positive conversion of
raise_error
withwith_message
. (#41)
- Fix crash on
expect.(obj).to non_matcher_object
in dynamic analysis (#39)
- Support conversion of
and_return { value }
andand_return
without arguments. - Fix a bug where conversion of
.any_number_of_times
andat_least(0)
withobj.stub(:message)
weren't reported in the final summary. - Fix a bug where arguments of
any_instance
implementation blocks weren't converted when areceive
matcher was chained by the fluent interface. (e.g.expect_any_instance_of(Klass).to receive(:message).once { |arg| }
)
- Conversion of
obj.stub(:message => value)
toallow(obj).to receive(:message).and_return(value)
is now opt-in with-t/--convert-stub-with-hash
option whenreceive_messages
is unavailable.
- Support conversion of
any_instance
block.
- Handle deprecation messages from
rainbow
gem.
- Native support for Ruby 2.1 syntax with Parser 2.1.
- Support conversion of the custom matcher DSL. (#30)
- Support Capybara DSL in static context analysis. (the logic used with
-s/--skip-dynamic-analysis
)
- Check whether a
stub
is RSpec's one or not with a static whitelist when there's no runtime data. (#33) - Fix a bug where one-liner
should
was converted tois_expected.to
on RSpec 3.0.0.beta1. (available since 2.99.0.beta2 and 3.0.0.beta2)
- Mention the project's RSpec version in the auto-generated commit message.
- Deprecate
-m/--generate-commit-message
option. (A commit message will always be generated) - Display actual
Proc
constructor names in the summary of expectations on block.
- Support Ruby 2.1 runtime by falling back to Ruby 2.0 parser.
- Support conversion of
RSpec::Core::ExampleGroup#example
. (#23) - Support conversion of one-liner syntax. (#25)
- Support conversion of one-liner syntax with
have(n).items
matcher. - Support conversion of
stub_chain
. - Fix a bug where
-p/--no-parentheses-matcher-arg
was not applied to the conversion ofhave(n).items
withexpect
. - Fix a bug where conversion summaries of
have(n).item
with negative expectation were reported as positive expectations.
- Proceed to conversion even if
rspec
didn't pass in dynamic analysis.
- Handle singular collection names like
have.(n).item
(#18) - Handle collection accessors with arguments like
have.(n).errors_on(...)
(#18) - Handle
described_class.any_instance
. (#18) - Handle indirect
any_instance
subject with runtime information. (e.g.variable = SomeClass.any_instance; variable.stub(:message)
) - Disable conversion of
have(n).items
automatically ifrspec-rails
orrspec-collection_matchers
is loaded in the target project. - Disable conversion of
its
automatically ifrspec-its
is loaded in the target project.
- Fix error
singleton can't be dumped. (TypeError)
at the end of dynamic analysis (#17) - Do not copy pseudo files. (device, socket, etc.) in dynamic analysis (#17)
- Fix error
undefined method receive_messages_available?
while conversion. (#17)
- Apply
-p/--no-parentheses-matcher-arg
to the conversion ofhave.(n).items
(obj.should have(n).items
is now converted toexpect(obj.size).to eq n
with-p/--no-parentheses-matcher-arg
)
- Transpec is now ready for RSpec 2.99 and 3.0 beta!.
- Support conversion to
allow.(obj).to receive_messages(:message => value)
(#6) - Support conversion to
be_truthy
/be_falsey
. (#8) - Add
-b/--boolean-matcher
option that allows to specify matcher type thatbe_true
andbe_false
will be converted to. - Abort if a target project's
rspec
gem dependency is older than the version required by Transpec.
- Allow use of non monkey patch syntaxes in non example group contexts by including
RSpec::Matchers
. (#15)
- Fix failure of dynamic analysis when cwd was changed at exit of rspec.
- Support conversion of
its
. (#9)
- Now Transpec does dynamic code analysis!.
- Support conversion of
have.(n).items
matcher (#5) - Add
-s/--skip-dynamic-analysis
option that allows to skip dynamic analysis and convert with only static analysis. - Add
-c/--rspec-command
option that allows to specify command to run RSpec that is used for dynamic analysis. - Check contexts correctly with runtime information.
- Detect same name but non-RSpec methods with runtime information. (#4)
- Consider runtime type information when converting
=~
tomatch_array
. - Rename
-d/--disable
option to-k/--keep
and change its syntax types. - Rename
--commit-message
option to--generate-commit-message
.
- Fix a bug where
Node#each_descendent_node
enumerates only within depth 2.
- Do not touch file if the source does not need to be rewritten.
- Improve context detection.
- Fix a bug where arguments of positive error expectation with block were removed. (e.g.
expect { }.to raise_error(SpecificErrorClass) { |e| ... }
was converted toexpect { }.to raise_error { |e| ... }
unintentionally)
- Fix a crash on syntax configuration with variable in
RSpec.configure
. (e.g.RSpec.configure { |config| config.expect_with { |c| c.syntax = some_syntax } }
)
- Fix a crash on operator matcher that have
__FILE__
in its arguments.
- Display conversion summary at the end.
- Add
-m/--commit-message
option that allows to generate commit message automatically.
- Avoid confusing
Excon.stub
with RSpec'sstub
. (#4) - Fix a bug where
be == 1
was converted intobe eq.(1)
(now it's converted intoeq(1)
) - Fix a bug where
obj.should==1
was converted intoobj.toeq1
. (now it's converted intoobj.to eq(1)
)
- Continue processing files even if a file has invalid syntax.
- Fix a crash on source
variable::Const
. - Fix generating invalid code with here document followed by method.
- Fix generating invalid code when converting
obj.should() == 1
.
- Fix a bug where
be > 1
was converted intobe be > 1
.
- Highlight source in console when warning conversion error.
- Add
--no-color
option.
- Support conversion of
at_least(0)
. - Add
-f
shorthand for--force
option.
- Use
--disable allow_to_receive
to disable conversion fromobj.should_receive.(:foo).any_number_of_times
toallow(obj).to receive(:foo)
(Previously it was--disable expect_to_receive
)
- Support conversion from
not_to raise_error(SpecificErrorClass)
tonot_to raise_error
.
- Avoid confusing
Typhoeus.stub
with RSpec'sstub
. (#4)
- Fix a bug where
SomeClass.any_instance.should_receive.(:message).any_number_of_times
was converted intoexpect_any_instance_of(SomeClass).to receive(:message)
unintentionally (now it's converted intoallow_any_instance_of(SomeClass).to receive(:message)
)
- Support conversion of
any_number_of_times
.
- Fix a bug where necessary parentheses were not added when converting operator matcher to non-operator matcher in some cases. (e.g.
== (2 - 1) + (1 + 2)
was converted intoeq(2 - 1) + (1 + 2)
unintentionally)
- Suppress addition of superfluous parentheses when converting operator matcher that have argument in parentheses to non-operator matcher. (e.g. from
== (2 - 1)
toeq(2 - 1)
) - Support auto-modification of syntax configuration in
RSpec.configure
.
- Support conversion from
be_close(expected, delta)
tobe_within(delta).of(expected)
.
- Initial release.