[前][次][番号順一覧][スレッド一覧]

ruby-changes:58022

From: Benoit <ko1@a...>
Date: Mon, 30 Sep 2019 02:14:05 +0900 (JST)
Subject: [ruby-changes:58022] d51b4e34fb (master): Update to ruby/mspec@5dda9fb

https://git.ruby-lang.org/ruby.git/commit/?id=d51b4e34fb

From d51b4e34fbdbe1a845aa2251b1fa3304de809b32 Mon Sep 17 00:00:00 2001
From: Benoit Daloze <eregontp@g...>
Date: Sun, 29 Sep 2019 19:13:35 +0200
Subject: Update to ruby/mspec@5dda9fb


diff --git a/spec/mspec/lib/mspec/expectations/expectations.rb b/spec/mspec/lib/mspec/expectations/expectations.rb
index b42dfeb..8d01dc2 100644
--- a/spec/mspec/lib/mspec/expectations/expectations.rb
+++ b/spec/mspec/lib/mspec/expectations/expectations.rb
@@ -7,6 +7,9 @@ class SpecExpectationNotFoundError < StandardError https://github.com/ruby/ruby/blob/trunk/spec/mspec/lib/mspec/expectations/expectations.rb#L7
   end
 end
 
+class SkippedSpecError < StandardError
+end
+
 class SpecExpectation
   def self.fail_with(expected, actual)
     expected_to_s = expected.to_s
diff --git a/spec/mspec/lib/mspec/helpers/warning.rb b/spec/mspec/lib/mspec/helpers/warning.rb
index f54e4ab..f94551c 100644
--- a/spec/mspec/lib/mspec/helpers/warning.rb
+++ b/spec/mspec/lib/mspec/helpers/warning.rb
@@ -1,3 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/spec/mspec/lib/mspec/helpers/warning.rb#L1
+require 'mspec/guards/version'
+
 def suppress_warning
   verbose = $VERBOSE
   $VERBOSE = nil
diff --git a/spec/mspec/lib/mspec/matchers.rb b/spec/mspec/lib/mspec/matchers.rb
index f3e8e7b..356e4a9 100644
--- a/spec/mspec/lib/mspec/matchers.rb
+++ b/spec/mspec/lib/mspec/matchers.rb
@@ -34,3 +34,4 @@ require 'mspec/matchers/output_to_fd' https://github.com/ruby/ruby/blob/trunk/spec/mspec/lib/mspec/matchers.rb#L34
 require 'mspec/matchers/respond_to'
 require 'mspec/matchers/signed_zero'
 require 'mspec/matchers/block_caller'
+require 'mspec/matchers/skip'
diff --git a/spec/mspec/lib/mspec/matchers/skip.rb b/spec/mspec/lib/mspec/matchers/skip.rb
new file mode 100644
index 0000000..7c175d3
--- /dev/null
+++ b/spec/mspec/lib/mspec/matchers/skip.rb
@@ -0,0 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/spec/mspec/lib/mspec/matchers/skip.rb#L1
+module MSpecMatchers
+  private def skip(reason = 'no reason')
+    raise SkippedSpecError, reason
+  end
+end
diff --git a/spec/mspec/lib/mspec/runner/context.rb b/spec/mspec/lib/mspec/runner/context.rb
index 30d8a4a..d72b947 100644
--- a/spec/mspec/lib/mspec/runner/context.rb
+++ b/spec/mspec/lib/mspec/runner/context.rb
@@ -214,7 +214,7 @@ class ContextState https://github.com/ruby/ruby/blob/trunk/spec/mspec/lib/mspec/runner/context.rb#L214
               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)
diff --git a/spec/mspec/lib/mspec/runner/mspec.rb b/spec/mspec/lib/mspec/runner/mspec.rb
index cfc1184..75a242b 100644
--- a/spec/mspec/lib/mspec/runner/mspec.rb
+++ b/spec/mspec/lib/mspec/runner/mspec.rb
@@ -105,6 +105,8 @@ module MSpec https://github.com/ruby/ruby/blob/trunk/spec/mspec/lib/mspec/runner/mspec.rb#L105
       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)
diff --git a/spec/mspec/spec/helpers/io_spec.rb b/spec/mspec/spec/helpers/io_spec.rb
index 86e4209..19f8384 100644
--- a/spec/mspec/spec/helpers/io_spec.rb
+++ b/spec/mspec/spec/helpers/io_spec.rb
@@ -99,9 +99,9 @@ describe Object, "#new_io" do https://github.com/ruby/ruby/blob/trunk/spec/mspec/spec/helpers/io_spec.rb#L99
     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
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]