spec/macros4cuke/formatter/to-trace_spec.rb in macros4cuke-0.4.08 vs spec/macros4cuke/formatter/to-trace_spec.rb in macros4cuke-0.4.09
- old
+ new
@@ -15,41 +15,41 @@
module Formatter # Open this namespace to get rid of module qualifier prefixes
describe ToTrace do
include UseSampleCollection # Add convenience methods for sample collection
-
+
let(:destination) { StringIO.new }
before(:all) do
# Fill the collection of macro-steps with sample steps
fill_collection
end
after(:all) do
- # Clear the collection to prevent interference between spec files
+ # Clear the collection to prevent interference between spec files
macro_coll.clear
end
context 'Initialization:' do
it 'should be created with an IO parameter' do
expect { ToTrace.new(destination) }.not_to raise_error
end
-
+
it 'should react to all the notifications' do
instance = ToTrace.new(destination)
expect(instance.implements).to eq(Formatter::AllNotifications)
end
end # context
-
-
+
+
context 'Provided services:' do
# Default instantiation rule
subject { ToTrace.new(destination) }
-
+
# The expected event trace for the sample collection
let(:expected_trace) do
trace_details = <<-SNIPPET
on_collection
on_step
@@ -133,11 +133,11 @@
on_collection_end
SNIPPET
trace_details
end
-
-
+
+
it 'should render the trace event for a given macro-step collection' do
service = FormattingService.new
service.register(subject)
expect { service.start!(macro_coll) }.not_to raise_error
expect(subject.io.string).to eq(expected_trace)