Update Rspec syntax
authorGreg Hurrell <greg@hurrell.net>
Mon, 20 Oct 2014 03:51:28 +0000 (20:51 -0700)
committerGreg Hurrell <greg@hurrell.net>
Mon, 20 Oct 2014 03:51:28 +0000 (20:51 -0700)
commitf4750c91c26f812ee89560f7c19e92420964a769
tree6953d2cb86e2567bba4983417f905db652f4ccac
parente278f5eb46e8a16915e555381a365a062fafe50e
Update Rspec syntax

Did this with the help of the transpec gem. Contrary to the README, I
found I did need to add it to the Gemfile (although obviously, I removed
it immediately afterwards).

Additionally it crashed trying to open `.git/COMMIT_EDITMSG` after the
conversion had completed, because I was running it from inside a
submodule; upstream issue for that:

  https://github.com/yujinakayama/transpec/issues/94

Here are the relevant bits of the output:

  Summary:

  415 conversions
    from: obj.should
      to: expect(obj).to
  382 conversions
    from: == expected
      to: eq(expected)
  100 conversions
    from: lambda { }.should
      to: expect { }.to
  35 conversions
    from: obj.should_not
      to: expect(obj).not_to
  32 conversions
    from: lambda { }.should_not
      to: expect { }.not_to
  2 conversions
    from: it { should_not ... }
      to: it { is_expected.not_to ... }
  1 conversion
    from: it { should ... }
      to: it { is_expected.to ... }

  967 conversions, 0 incompletes, 0 warnings, 0 errors

Sure beats doing it by hand, or even with Vim macros...
21 files changed:
spec/additions/proc_spec.rb
spec/additions/regexp_spec.rb
spec/additions/string_spec.rb
spec/and_predicate_spec.rb
spec/grammar_spec.rb
spec/match_data_wrapper_spec.rb
spec/memoizing_cache_spec.rb
spec/not_predicate_spec.rb
spec/parser_state_spec.rb
spec/parslet_choice_spec.rb
spec/parslet_combining_spec.rb
spec/parslet_merge_spec.rb
spec/parslet_omission_spec.rb
spec/parslet_repetition_spec.rb
spec/parslet_sequence_spec.rb
spec/predicate_spec.rb
spec/proc_parslet_spec.rb
spec/regexp_parslet_spec.rb
spec/string_enumerator_spec.rb
spec/string_parslet_spec.rb
spec/symbol_parslet_spec.rb