This repository has been archived by the owner on Nov 27, 2017. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from gongo/supress_warnings
Supress warnings
- Loading branch information
Showing
6 changed files
with
69 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,2 @@ | ||
--colour | ||
--format documentation | ||
--order random | ||
--tag ~before_load |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,64 @@ | ||
require 'table_beet' | ||
require 'coveralls' | ||
Coveralls.wear! | ||
|
||
|
||
if RSpec::Core::Version::STRING >= '3.2.0' | ||
require 'rspec/core/sandbox' | ||
else | ||
require 'rspec/core' | ||
|
||
# See: https://github.com/rspec/rspec-core/blob/v3.2.2/lib/rspec/core/sandbox.rb | ||
module RSpec | ||
|
||
class << self | ||
# For RSpec 3.1.x | ||
attr_writer :configuration, :world unless RSpec.respond_to?(:configuration=) | ||
end | ||
|
||
module Core | ||
module Sandbox | ||
def self.sandboxed | ||
orig_config = RSpec.configuration | ||
orig_world = RSpec.world | ||
|
||
RSpec.configuration = RSpec::Core::Configuration.new | ||
RSpec.world = RSpec::Core::World.new(RSpec.configuration) | ||
|
||
yield RSpec.configuration | ||
ensure | ||
RSpec.configuration = orig_config | ||
RSpec.world = orig_world | ||
end | ||
end | ||
end | ||
end | ||
end | ||
|
||
require 'table_beet' | ||
|
||
FIXTURES_PATH = File.dirname(__FILE__) + '/fixtures/steps' | ||
OUTPUT_PATH = File.dirname(__FILE__) + '/stepdoc' | ||
|
||
RSpec.configure do |c| | ||
c.around(:each) do |ex| | ||
# | ||
# Reset the added steps | ||
# on https://github.com/jnicklas/turnip/blob/v1.2.4/lib/turnip/dsl.rb#L21 | ||
# | ||
RSpec::Core::Sandbox.sandboxed do |config| | ||
# | ||
# Sandbox config does not included Turnip::Steps yet. | ||
# | ||
config.include Turnip::Steps, turnip: true | ||
|
||
ex.run | ||
|
||
# | ||
# Reset the addes 'global' steps | ||
# | ||
Turnip::Steps.instance_methods.each do |method| | ||
Turnip::Steps.module_eval { undef_method method } | ||
end | ||
end | ||
end | ||
end |