rails_plugins/rspec/spec/spec/story/extensions/main_spec.rb in picolena-0.1.5 vs rails_plugins/rspec/spec/spec/story/extensions/main_spec.rb in picolena-0.1.6
- old
+ new
@@ -49,11 +49,11 @@
it "should tell the PlainTextStoryRunner to run with run_story" do
runner = mock("runner")
Spec::Story::Runner::PlainTextStoryRunner.should_receive(:new).and_return(runner)
runner.should_receive(:run)
@main.run_story
- end
+ end
end
describe Main, "#steps_for" do
it_should_behave_like "the main object extended with Main"
@@ -112,42 +112,42 @@
end
end
describe Main, "#with_steps_for running a story" do
it_should_behave_like "the main object extended with Main"
-
+
before(:each) do
@runner = mock("runner")
@runner_step_group = StepGroup.new
@runner.stub!(:steps).and_return(@runner_step_group)
@runner.stub!(:run)
Spec::Story::Runner::PlainTextStoryRunner.stub!(:new).and_return(@runner)
end
-
+
it "should create a PlainTextStoryRunner with a path" do
Spec::Story::Runner::PlainTextStoryRunner.should_receive(:new).with('path/to/file',{}).and_return(@runner)
@main.with_steps_for(:foo) do
run 'path/to/file'
end
end
-
+
it "should create a PlainTextStoryRunner with a path and options" do
Spec::Story::Runner::PlainTextStoryRunner.should_receive(:new).with(anything,{:bar => :baz}).and_return(@runner)
@main.with_steps_for(:foo) do
run 'path/to/file', :bar => :baz
end
end
-
+
it "should pass the group it creates to the runner's steps" do
steps = @main.steps_for(:ice_cream) do
Given("vanilla") {}
end
@main.with_steps_for(:ice_cream) do
run 'foo'
end
@runner_step_group.should have_step(:given, "vanilla")
end
-
+
it "should run a story" do
@runner.should_receive(:run)
Spec::Story::Runner::PlainTextStoryRunner.should_receive(:new).and_return(@runner)
@main.with_steps_for(:foo) do
run 'path/to/file'
\ No newline at end of file