spec/support/approvals.rb in codependency-2.0.0 vs spec/support/approvals.rb in codependency-2.1.0
- old
+ new
@@ -1,13 +1,26 @@
require 'rspec/approvals'
+
+##
+# Simple shared context for allowing fixture-based examples to be
+# declared by using the example and example group names.
+# See graph_spec.rb for examples.
+shared_context 'fixtures', :fixtures => true do
+ let( :dirname ){ example.example_group.description }
+ let( :basename ){ example.description }
+ let( :file ){ File.join './spec/fixtures', dirname, basename }
+
+ before { subject.path << './spec/fixtures' }
+ before { subject.require file }
+end