spec/support/examples.rb in transcriber-0.0.3 vs spec/support/examples.rb in transcriber-0.0.4
- old
+ new
@@ -1,7 +1,11 @@
module Examples
- def context_from_example(file, &block)
- context "example #{file}" do
+ def describe_example(file, &block)
+ describe "example #{file}" do
+ [:Root, :Item, :Customer, :Entry].each do |klass|
+ Examples.send(:remove_const, klass) if Examples.const_defined?(klass)
+ end
+
silently {eval File.read("examples/#{file}.rb")}
variables = instance_variables.reject {|var| var.to_s =~ /metadata$/}
values = variables.inject({}) do |buffer, name|