lib/minitest-vcr/spec.rb in minitest-vcr-1.0.0 vs lib/minitest-vcr/spec.rb in minitest-vcr-1.0.1
- old
+ new
@@ -23,17 +23,25 @@
end # Spec
module StringHelpers
def self.vcr_path(example_class_name, example, spec_name)
+ # TODO Refactor! To tired but this is wack.
+ @path = nil
+
example_class_name.scan(/^(.*?)::[#a-z]/) do |class_names|
+
class_name = class_names.flatten.first
if class_name.nil?
@path = prep example.class.name
else
@path = prep(example.class.name.gsub(class_name, "")).unshift(class_name)
end
+ end
+
+ if @path.nil?
+ @path = prep example.class.name
end
@path.push(spec_name).join("/") unless @path.nil?
end