Skip to content

Commit

Permalink
Update to ruby/mspec@5dda9fb
Browse files Browse the repository at this point in the history
  • Loading branch information
eregon committed Sep 29, 2019
1 parent 2d41c71 commit d51b4e3
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 3 deletions.
3 changes: 3 additions & 0 deletions spec/mspec/lib/mspec/expectations/expectations.rb
Expand Up @@ -7,6 +7,9 @@ def message
end
end

class SkippedSpecError < StandardError
end

class SpecExpectation
def self.fail_with(expected, actual)
expected_to_s = expected.to_s
Expand Down
2 changes: 2 additions & 0 deletions spec/mspec/lib/mspec/helpers/warning.rb
@@ -1,3 +1,5 @@
require 'mspec/guards/version'

def suppress_warning
verbose = $VERBOSE
$VERBOSE = nil
Expand Down
1 change: 1 addition & 0 deletions spec/mspec/lib/mspec/matchers.rb
Expand Up @@ -34,3 +34,4 @@
require 'mspec/matchers/respond_to'
require 'mspec/matchers/signed_zero'
require 'mspec/matchers/block_caller'
require 'mspec/matchers/skip'
5 changes: 5 additions & 0 deletions spec/mspec/lib/mspec/matchers/skip.rb
@@ -0,0 +1,5 @@
module MSpecMatchers
private def skip(reason = 'no reason')
raise SkippedSpecError, reason
end
end
2 changes: 1 addition & 1 deletion spec/mspec/lib/mspec/runner/context.rb
Expand Up @@ -214,7 +214,7 @@ def process
if example
passed = protect nil, example
MSpec.actions :example, state, example
protect nil, @expectation_missing unless MSpec.expectation? or !passed
protect nil, @expectation_missing if !MSpec.expectation? and passed
end
end
protect "after :each", post(:each)
Expand Down
2 changes: 2 additions & 0 deletions spec/mspec/lib/mspec/runner/mspec.rb
Expand Up @@ -105,6 +105,8 @@ def self.protect(location, &block)
return true
rescue SystemExit => e
raise e
rescue SkippedSpecError => e
return false
rescue Exception => exc
register_exit 1
actions :exception, ExceptionState.new(current && current.state, location, exc)
Expand Down
4 changes: 2 additions & 2 deletions spec/mspec/spec/helpers/io_spec.rb
Expand Up @@ -99,9 +99,9 @@
rm_r @name
end

it "returns an IO instance" do
it "returns a File instance" do
@io = new_io @name
@io.should be_an_instance_of(IO)
@io.should be_an_instance_of(File)
end

it "opens the IO for reading if passed 'r'" do
Expand Down

0 comments on commit d51b4e3

Please sign in to comment.