[Pkg-puppet-devel] [facter] 30/46: (maint) De-duplicate parses RSpec alias
Stig Sandbeck Mathisen
ssm at debian.org
Sun Sep 1 10:47:31 UTC 2013
This is an automated email from the git hooks/post-receive script.
ssm pushed a commit to branch master
in repository facter.
commit 423a3bca3c4b9beace9e1ba7490191d8eaa0625b
Author: Jeff McCune <jeff at puppetlabs.com>
Date: Fri May 24 11:25:18 2013 -0700
(maint) De-duplicate parses RSpec alias
Adrien pointed out the duplication of
RSpec.configure do |config|
config.alias_it_should_behave_like_to :example_behavior_for, "parses"
end
in both of the interfaces_spec file and the netmask_spec file. This
patch removes the duplicate statements and places them in a shared file
required by both example specs.
---
spec/shared_formats/parses.rb | 3 +++
spec/unit/interfaces_spec.rb | 5 +----
spec/unit/netmask_spec.rb | 5 +----
3 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/spec/shared_formats/parses.rb b/spec/shared_formats/parses.rb
new file mode 100644
index 0000000..f3be03a
--- /dev/null
+++ b/spec/shared_formats/parses.rb
@@ -0,0 +1,3 @@
+RSpec.configure do |config|
+ config.alias_it_should_behave_like_to :example_behavior_for, "parses"
+end
diff --git a/spec/unit/interfaces_spec.rb b/spec/unit/interfaces_spec.rb
index 6def1c6..41a7d66 100755
--- a/spec/unit/interfaces_spec.rb
+++ b/spec/unit/interfaces_spec.rb
@@ -1,6 +1,7 @@
#! /usr/bin/env ruby
require 'spec_helper'
+require 'shared_formats/parses'
require 'facter/util/ip'
shared_examples_for "netmask_* from ifconfig output" do |platform, interface, address, fixture|
@@ -15,10 +16,6 @@ shared_examples_for "netmask_* from ifconfig output" do |platform, interface, ad
end
end
-RSpec.configure do |config|
- config.alias_it_should_behave_like_to :example_behavior_for, "parses"
-end
-
describe "Per Interface IP facts" do
it "should replace the ':' in an interface list with '_'" do
# So we look supported
diff --git a/spec/unit/netmask_spec.rb b/spec/unit/netmask_spec.rb
index dcbcfdd..ce77eef 100644
--- a/spec/unit/netmask_spec.rb
+++ b/spec/unit/netmask_spec.rb
@@ -1,6 +1,7 @@
#! /usr/bin/env ruby
require 'spec_helper'
+require 'shared_formats/parses'
require 'facter/util/ip'
shared_examples_for "netmask from ifconfig output" do |platform, address, fixture|
@@ -12,10 +13,6 @@ shared_examples_for "netmask from ifconfig output" do |platform, address, fixtur
end
end
-RSpec.configure do |config|
- config.alias_it_should_behave_like_to :example_behavior_for, "parses"
-end
-
describe "netmask fact" do
before :each do
Facter.fact(:kernel).stubs(:value).returns("Linux")
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-puppet/facter.git
More information about the Pkg-puppet-devel
mailing list