Jon Arrien

Tag: TDD

New in RSpec 3

  • Removed support for Ruby 1.8.6 & 1.9.1
  • Improved Ruby 2.0 support
  • New rspec-support gem
  • Ability to disable all of the monkey patching mode with one option
  • :each and :all have now aliases => :example and :context
  • describe, shared_examples_for and shared_context methods under RSpec module.
  • xdescribe,  xcontext and xit for examples
  • fdescribe, fcontext and fit to set :focus => true
  • Changes in pending, introduced skip
  • Added is_expected
  • Groups can be ordered individually
  • Improvements in rspec —init
  • New —dry-run CLI option
  • Completely new formatter API
  • Removed expect_with  :stdlib. Instead explicit :text_unit and :minitest.
  • Added define_derived_metadata to tag all specs in a group
  • Ability to chain multiple matchers togethers using and or or (Aliases for & and | )
  • match matcher can be used for data structures
  • New all matcher
  • New be_between matcher
  • Boolean matchers renamed to be_truthy and be_falsey
  • match_array renamed to contain_exactly
  • Improved integration with minitest
  • Removed mock and stub aliases of double
  • File-type inference disabled by default

 

 

 

Spring with Cucumber & RSpec

Spring and Guard allows us to see tests running almost immediately after hitting save on a Feature or Spec. Once you’ve setup RSpec and Cucumber, just add spring commands to take its benefits:

[cc lang=”ruby”]
group :development, :test do
# …
gem ‘spring-commands-rspec’
gem ‘spring-commands-cucumber’
# …
end
[/cc]

Launch binstubs to let commands available for spring:
[cc lang=”bash”]
% bundle install
% spring binstub –all
* bin/rake: spring already present
* bin/rspec: generated with spring
* bin/rails: spring already present
[/cc]

And remember prepending spring before rspec or cucumber command.
[cc lang=”ruby”]
guard :rspec, cmd:”spring rspec” do
[/cc]

Also read this post if you want to integrate with Sublime Text:
Spring + ST3

Is TDD dead?

On Friday, May 9th at 11am eastern (17pm in Spain) will take place an interesting live discussion about TDD.

istddDeadGooglePlusBanner

Copyright © 2017 Jon Arrien

Theme by Anders NorenUp ↑