rspectacular 0.11.0 → 0.11.1
Sign up to get free protection for your applications and to get access to all the features.
@@ -1,12 +1,14 @@
|
|
1
|
+
require 'singleton'
|
2
|
+
|
1
3
|
RSpec.configure do |config|
|
2
4
|
config.around(:each, :singletons => lambda { |v| !!v }) do |example|
|
3
5
|
options = example.metadata[:singletons]
|
4
|
-
singletons_to_reset = options.respond_to?(:each) ? options : []
|
6
|
+
singletons_to_reset = options.respond_to?(:each) ? options : [options]
|
5
7
|
|
6
8
|
example.run
|
7
9
|
|
8
10
|
singletons_to_reset.each do |singleton|
|
9
|
-
|
11
|
+
Singleton.__init__(singleton)
|
10
12
|
end
|
11
13
|
end
|
12
14
|
end
|
data/lib/rspectacular/version.rb
CHANGED