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

ruby-changes:59537

From: Benoit <ko1@a...>
Date: Sat, 28 Dec 2019 01:36:41 +0900 (JST)
Subject: [ruby-changes:59537] 74fdc1e60f (master): Update to ruby/mspec@673fcab

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

From 74fdc1e60fb8ba03f5cdb09866c75bbe5dbce936 Mon Sep 17 00:00:00 2001
From: Benoit Daloze <eregontp@g...>
Date: Fri, 27 Dec 2019 17:36:04 +0100
Subject: Update to ruby/mspec@673fcab


diff --git a/spec/mspec/lib/mspec/expectations/should.rb b/spec/mspec/lib/mspec/expectations/should.rb
index 231ad15..ca06174 100644
--- a/spec/mspec/lib/mspec/expectations/should.rb
+++ b/spec/mspec/lib/mspec/expectations/should.rb
@@ -3,7 +3,10 @@ class Object https://github.com/ruby/ruby/blob/trunk/spec/mspec/lib/mspec/expectations/should.rb#L3
 
   def should(matcher = NO_MATCHER_GIVEN)
     MSpec.expectation
-    MSpec.actions :expectation, MSpec.current.state
+    state = MSpec.current.state
+    raise "should outside example" unless state
+    MSpec.actions :expectation, state
+
     if NO_MATCHER_GIVEN.equal?(matcher)
       SpecPositiveOperatorMatcher.new(self)
     else
@@ -16,7 +19,10 @@ class Object https://github.com/ruby/ruby/blob/trunk/spec/mspec/lib/mspec/expectations/should.rb#L19
 
   def should_not(matcher = NO_MATCHER_GIVEN)
     MSpec.expectation
-    MSpec.actions :expectation, MSpec.current.state
+    state = MSpec.current.state
+    raise "should_not outside example" unless state
+    MSpec.actions :expectation, state
+
     if NO_MATCHER_GIVEN.equal?(matcher)
       SpecNegativeOperatorMatcher.new(self)
     else
-- 
cgit v0.10.2


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

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