lib/fdoc/spec_watcher.rb in fdoc-0.3.2 vs lib/fdoc/spec_watcher.rb in fdoc-0.3.3
- old
+ new
@@ -33,10 +33,12 @@
end
end
end
def path
- if respond_to?(:example) # Rspec 2
+ if RSpec.respond_to?(:current_example) # Rspec 3
+ RSpec.current_example.metadata[:fdoc]
+ elsif respond_to?(:example) # Rspec 2
example.metadata[:fdoc]
else # Rspec 1.3.2
opts = {}
__send__(:example_group_hierarchy).each do |example|
opts.merge!(example.options)