summaryrefslogtreecommitdiff
path: root/spec/mspec/spec/runner/formatters/file_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/mspec/spec/runner/formatters/file_spec.rb')
-rw-r--r--spec/mspec/spec/runner/formatters/file_spec.rb34
1 files changed, 17 insertions, 17 deletions
diff --git a/spec/mspec/spec/runner/formatters/file_spec.rb b/spec/mspec/spec/runner/formatters/file_spec.rb
index 946683ad58..ae11d60845 100644
--- a/spec/mspec/spec/runner/formatters/file_spec.rb
+++ b/spec/mspec/spec/runner/formatters/file_spec.rb
@@ -3,27 +3,27 @@ require 'mspec/runner/formatters/file'
require 'mspec/runner/mspec'
require 'mspec/runner/example'
-describe FileFormatter, "#register" do
+RSpec.describe FileFormatter, "#register" do
before :each do
@formatter = FileFormatter.new
- MSpec.stub(:register)
- MSpec.stub(:unregister)
+ allow(MSpec).to receive(:register)
+ allow(MSpec).to receive(:unregister)
end
it "registers self with MSpec for :load, :unload actions" do
- MSpec.should_receive(:register).with(:load, @formatter)
- MSpec.should_receive(:register).with(:unload, @formatter)
+ expect(MSpec).to receive(:register).with(:load, @formatter)
+ expect(MSpec).to receive(:register).with(:unload, @formatter)
@formatter.register
end
it "unregisters self with MSpec for :before, :after actions" do
- MSpec.should_receive(:unregister).with(:before, @formatter)
- MSpec.should_receive(:unregister).with(:after, @formatter)
+ expect(MSpec).to receive(:unregister).with(:before, @formatter)
+ expect(MSpec).to receive(:unregister).with(:after, @formatter)
@formatter.register
end
end
-describe FileFormatter, "#load" do
+RSpec.describe FileFormatter, "#load" do
before :each do
@state = ExampleState.new ContextState.new("describe"), "it"
@formatter = FileFormatter.new
@@ -31,19 +31,19 @@ describe FileFormatter, "#load" do
end
it "resets the #failure? flag to false" do
- @formatter.failure?.should be_true
+ expect(@formatter.failure?).to be_truthy
@formatter.load @state
- @formatter.failure?.should be_false
+ expect(@formatter.failure?).to be_falsey
end
it "resets the #exception? flag to false" do
- @formatter.exception?.should be_true
+ expect(@formatter.exception?).to be_truthy
@formatter.load @state
- @formatter.exception?.should be_false
+ expect(@formatter.exception?).to be_falsey
end
end
-describe FileFormatter, "#unload" do
+RSpec.describe FileFormatter, "#unload" do
before :each do
$stdout = @out = IOStub.new
@formatter = FileFormatter.new
@@ -56,21 +56,21 @@ describe FileFormatter, "#unload" do
it "prints a '.' if there was no exception raised" do
@formatter.unload(@state)
- @out.should == "."
+ expect(@out).to eq(".")
end
it "prints an 'F' if there was an expectation failure" do
exc = SpecExpectationNotMetError.new "failed"
@formatter.exception ExceptionState.new(@state, nil, exc)
@formatter.unload(@state)
- @out.should == "F"
+ expect(@out).to eq("F")
end
it "prints an 'E' if there was an exception other than expectation failure" do
exc = MSpecExampleError.new("boom!")
@formatter.exception ExceptionState.new(@state, nil, exc)
@formatter.unload(@state)
- @out.should == "E"
+ expect(@out).to eq("E")
end
it "prints an 'E' if there are mixed exceptions and exepctation failures" do
@@ -79,6 +79,6 @@ describe FileFormatter, "#unload" do
exc = MSpecExampleError.new("boom!")
@formatter.exception ExceptionState.new(@state, nil, exc)
@formatter.unload(@state)
- @out.should == "E"
+ expect(@out).to eq("E")
end
end