From 114bc0d6e850ec96e81f763651bdeb0cd167eda6 Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Mon, 2 Jun 2014 12:09:38 +0200 Subject: [PATCH] Upgrade to RSpec 3.0. For this I've enabled both the old expectation and stubbing/mocking syntax. The old syntax is much more compact and to me reads nicer. For example, consider the following: lex('').should == [...] To me this reads much nicer than this: expect(lex('')).to eq([...]) --- oga.gemspec | 2 +- spec/spec_helper.rb | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/oga.gemspec b/oga.gemspec index 118bbf5..0afafac 100644 --- a/oga.gemspec +++ b/oga.gemspec @@ -37,7 +37,7 @@ Gem::Specification.new do |s| s.add_dependency 'ast' s.add_development_dependency 'rake' - s.add_development_dependency 'rspec' + s.add_development_dependency 'rspec', ['~> 3.0'] s.add_development_dependency 'yard' s.add_development_dependency 'simplecov' s.add_development_dependency 'kramdown' diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 8413653..1449041 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -11,4 +11,12 @@ require_relative 'support/parsing' RSpec.configure do |config| config.color = true config.include Oga::ParsingHelpers + + config.expect_with :rspec do |c| + c.syntax = [:should, :expect] + end + + config.mock_with :rspec do |c| + c.syntax = [:should, :expect] + end end