mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to ruby/mspec@5dda9fb
This commit is contained in:
parent
2d41c712a7
commit
d51b4e34fb
7 changed files with 16 additions and 3 deletions
|
@ -7,6 +7,9 @@ class SpecExpectationNotFoundError < StandardError
|
|||
end
|
||||
end
|
||||
|
||||
class SkippedSpecError < StandardError
|
||||
end
|
||||
|
||||
class SpecExpectation
|
||||
def self.fail_with(expected, actual)
|
||||
expected_to_s = expected.to_s
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
require 'mspec/guards/version'
|
||||
|
||||
def suppress_warning
|
||||
verbose = $VERBOSE
|
||||
$VERBOSE = nil
|
||||
|
|
|
@ -34,3 +34,4 @@ require 'mspec/matchers/output_to_fd'
|
|||
require 'mspec/matchers/respond_to'
|
||||
require 'mspec/matchers/signed_zero'
|
||||
require 'mspec/matchers/block_caller'
|
||||
require 'mspec/matchers/skip'
|
||||
|
|
5
spec/mspec/lib/mspec/matchers/skip.rb
Normal file
5
spec/mspec/lib/mspec/matchers/skip.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
module MSpecMatchers
|
||||
private def skip(reason = 'no reason')
|
||||
raise SkippedSpecError, reason
|
||||
end
|
||||
end
|
|
@ -214,7 +214,7 @@ class ContextState
|
|||
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)
|
||||
|
|
|
@ -105,6 +105,8 @@ module MSpec
|
|||
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)
|
||||
|
|
|
@ -99,9 +99,9 @@ describe Object, "#new_io" do
|
|||
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
|
||||
|
|
Loading…
Reference in a new issue