зеркало из https://github.com/github/ruby.git
Update to ruby/mspec@5dda9fb
This commit is contained in:
Родитель
2d41c712a7
Коммит
d51b4e34fb
|
@ -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'
|
||||
|
|
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче