rspectacular 0.10.1 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rspectacular/plugins/singleton.rb +12 -0
- data/lib/rspectacular/version.rb +1 -1
- metadata +2 -1
@@ -0,0 +1,12 @@
|
|
1
|
+
RSpec.configure do |config|
|
2
|
+
config.around(:each, :singletons => lambda { |v| !!v }) do |example|
|
3
|
+
options = example.metadata[:singletons]
|
4
|
+
singletons_to_reset = options.respond_to?(:each) ? options : []
|
5
|
+
|
6
|
+
example.run
|
7
|
+
|
8
|
+
singletons_to_reset.each do |singleton|
|
9
|
+
singleton.class_variable_set(:@@singleton__instance__, nil)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
data/lib/rspectacular/version.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: rspectacular
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.
|
5
|
+
version: 0.11.0
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- jfelchner
|
@@ -77,6 +77,7 @@ files:
|
|
77
77
|
- lib/rspectacular/plugins/paypal.rb
|
78
78
|
- lib/rspectacular/plugins/recaptcha.rb
|
79
79
|
- lib/rspectacular/plugins/shoulda.rb
|
80
|
+
- lib/rspectacular/plugins/singleton.rb
|
80
81
|
- lib/rspectacular/plugins/timecop.rb
|
81
82
|
- lib/rspectacular/plugins/vcr.rb
|
82
83
|
- lib/rspectacular/plugins/webmock.rb
|