spec/teabag/runner_spec.rb in teabag-0.3.2 vs spec/teabag/runner_spec.rb in teabag-0.3.3
- old
+ new
@@ -1,8 +1,7 @@
require "spec_helper"
require "teabag/runner"
-require "teabag/formatters/progress_formatter"
require "teabag/exceptions"
describe Teabag::Runner do
before do
@@ -11,11 +10,15 @@
end
describe "its constructor" do
it "creates a progress formatter if no other formatter is provided" do
- subject.formatters.first.should be_a(Teabag::Formatters::ProgressFormatter)
+ Teabag::Formatters::XmlFormatter = Class.new
+ Teabag.configuration.formatters = "progress, xml"
+ expect(subject.formatters[0]).to be_a(Teabag::Formatters::ProgressFormatter)
+ expect(subject.formatters[1]).to be_a(Teabag::Formatters::XmlFormatter)
+ Teabag.configuration.formatters = "progress"
end
end
describe "#process" do
@@ -64,10 +67,10 @@
subject.process('{"_teabag": true, "type": "spec", "status": "passed"}')
subject.process('{"_teabag": true, "type": "spec", "status": "pending"}')
subject.process('{"_teabag": true, "type": "error"}')
subject.process('{"_teabag": true, "type": "exception"}')
subject.process('{"_teabag": true, "type": "results"}')
- subject.failure_count.should == 1
+ expect(subject.failure_count).to be(1)
end
end
end