Permalink
Browse files

update to RSpec 3.1

  • Loading branch information...
1 parent 3a3b7e2 commit bd80ddde5eac6641574739955a4b8154c57d9cfc @e2 e2 committed Dec 8, 2014
Showing with 31 additions and 10 deletions.
  1. +2 −0 .rspec
  2. +1 −1 guard-livereload.gemspec
  3. +1 −3 spec/lib/guard/livereload/reactor_spec.rb
  4. +1 −3 spec/lib/guard/livereload_spec.rb
  5. +26 −3 spec/spec_helper.rb
View
@@ -0,0 +1,2 @@
+--color
+--require spec_helper
@@ -24,5 +24,5 @@ Gem::Specification.new do |s|
s.add_development_dependency 'bundler', '>= 1.3.5'
s.add_development_dependency 'rake'
- s.add_development_dependency 'rspec'
+ s.add_development_dependency 'rspec', '~> 3.1'
end
@@ -1,6 +1,4 @@
-require 'spec_helper'
-
-describe Guard::LiveReload::Reactor do
+RSpec.describe Guard::LiveReload::Reactor do
let(:paths) { %w[stylesheets/layout.css stylesheets/style.css] }
before do
@@ -1,8 +1,6 @@
-require 'spec_helper'
-
require "guard/compat/test/helper"
-describe Guard::LiveReload do
+RSpec.describe Guard::LiveReload do
let(:plugin) { Guard::LiveReload.new }
let(:reactor) { double(Guard::LiveReload::Reactor) }
before { allow(plugin).to receive(:reactor) { reactor } }
View
@@ -3,10 +3,33 @@
require 'rspec'
require 'guard/livereload'
-ENV["GUARD_ENV"] = 'test'
RSpec.configure do |config|
- config.color = true
- config.filter_run focus: true
+
+ def ci?
+ ENV['CI'] == 'true'
+ end
+
+ config.expect_with :rspec do |expectations|
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
+ end
+
+ config.mock_with :rspec do |mocks|
+ mocks.verify_partial_doubles = true
+ end
+
+ config.filter_run focus: !ci?
config.run_all_when_everything_filtered = true
+
+ config.disable_monkey_patching!
+
+ config.warnings = true
+
+ config.default_formatter = 'doc' if config.files_to_run.one?
+
+ #config.profile_examples = 10
+
+ config.order = :random
+
+ Kernel.srand config.seed
end

0 comments on commit bd80ddd

Please sign in to comment.