spec/lucid/app_spec.rb in lucid-0.3.3 vs spec/lucid/app_spec.rb in lucid-0.4.0
- old
+ new
@@ -1,7 +1,7 @@
require 'spec_helper'
-require 'lucid/tdl_builder'
+require 'lucid/spec_builder'
require 'gherkin/formatter/model'
module Lucid
module CLI
describe App do
@@ -21,19 +21,19 @@
subject.start!(runtime)
end
it 'configures the runtime' do
configuration = double('Configuration').as_null_object
- Configuration.stub(:new => configuration)
+ Context.stub(:new => configuration)
runtime.should_receive(:configure).with(configuration)
kernel.should_receive(:exit).with(1)
do_start
end
it 'uses that runtime for running and reporting results' do
results = double('results', :failure? => true)
- runtime.should_receive(:run)
+ runtime.should_receive(:execute)
runtime.stub(:results).and_return(results)
kernel.should_receive(:exit).with(1)
do_start
end
end
@@ -43,12 +43,12 @@
Lucid.wants_to_quit = false
end
it 'should register as a failure' do
results = double('results', :failure? => false)
- runtime = Runtime.any_instance
- runtime.stub(:run)
+ runtime = ContextLoader.any_instance
+ runtime.stub(:excute)
runtime.stub(:results).and_return(results)
Lucid.wants_to_quit = true
kernel.should_receive(:exit).with(1)
subject.start!
@@ -56,11 +56,11 @@
end
end
describe 'verbose execution' do
before(:each) do
- b = Lucid::Parser::TDLBuilder.new('specs/test.spec')
+ b = Lucid::Parser::SpecBuilder.new('specs/test.spec')
b.feature(Gherkin::Formatter::Model::Feature.new([], [], 'Feature', 'Testing', '', 99, ''))
b.language = double
@empty_feature = b.result
end
@@ -72,21 +72,9 @@
kernel.should_receive(:exit).with(0)
cli.start!
stdout.string.should include('test.spec')
- end
- end
-
- describe 'handling exceptions' do
- [ProfilesNotDefinedError, YmlLoadError, ProfileNotFound].each do |exception_class|
- it "rescues #{exception_class}, prints the message to the error stream" do
- Configuration.stub(:new).and_return(configuration = double('configuration'))
- configuration.stub(:parse).and_raise(exception_class.new('error message'))
-
- subject.start!
- stderr.string.should == "error message\n"
- end
end
end
end
end