minitest-mock_expectations 1.1.2 → 1.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2adcab05aae81e343becab28c6f8c3181f92d81294de224656ea678cf96004d5
4
- data.tar.gz: 2fe148fee3686d80e0509a5711f523aa5b407b7fd929e4719fef734972943a4a
3
+ metadata.gz: 1419043ab236bcdc59b750babd75560159109bb694867a686c6fc723d67b7585
4
+ data.tar.gz: 510d6192b4be603cfc422f4e1524e2f35b96f85972629c836d633f5ba595511e
5
5
  SHA512:
6
- metadata.gz: 236932920587374d39cc3837c54db5a9bb5464c86c45375152975cf95f72b6e7128ca6ec4617a682952b1f27360e545b7b22a18c524d2fa14dbdddcdcbc3c1d8
7
- data.tar.gz: 3ef5fcf49a4b74aa1eb5f0d3427e37bad70a12c80591f79661291c9df3517eda76689732b327c0024930a2adb13f7067e0afadfdbcb1833eb84582851fdd2e31
6
+ metadata.gz: a5c7fd6a463a7acebe7f53dcefa21ee6158dec1065e72b97ce7879ae630c48a98866f4268765bb4c4bcbd625e87367a3cb73aefe2634dcb1e31025d97d0cd671
7
+ data.tar.gz: 24285ebaff1c6fa31b5198eb5eb57d56958d68462e7cbc024d430a1e071ef7a946061f6e851f7f9954a31cd99563bb6cc81b34d7ebab7457013cc1352dc59ccb
@@ -1,4 +1,8 @@
1
- ### 1.1.2 / Aprir 24, 2020
1
+ ### 1.1.3 / April 24, 2020
2
+
3
+ * Revert "Fix `assert_called_with` with an array as expected argument.".
4
+
5
+ ### 1.1.2 / April 24, 2020
2
6
 
3
7
  * Fix `assert_called_with` with an array as expected argument.
4
8
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- minitest-mock_expectations (1.1.2)
4
+ minitest-mock_expectations (1.1.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -137,17 +137,23 @@ end
137
137
  ```
138
138
 
139
139
  ```ruby
140
- assert_called_with(@post, :add_comment, [["Thanks for sharing this."]]) do
140
+ assert_called_with(@post, :add_comment, [[["Thanks for sharing this."]]]) do
141
141
  @post.add_comment(["Thanks for sharing this."])
142
142
  end
143
143
  ```
144
144
 
145
145
  ```ruby
146
- assert_called_with(@post, :add_comment, [["Thanks for sharing this.", "Thanks!"]]) do
146
+ assert_called_with(@post, :add_comment, [[["Thanks for sharing this.", "Thanks!"]]]) do
147
147
  @post.add_comment(["Thanks for sharing this.", "Thanks!"])
148
148
  end
149
149
  ```
150
150
 
151
+ ```ruby
152
+ assert_called_with(@post, :add_comment, [[["Thanks for sharing this."], ["Thanks!"]]]) do
153
+ @post.add_comment(["Thanks for sharing this."], ["Thanks!"])
154
+ end
155
+ ```
156
+
151
157
  ```ruby
152
158
  assert_called_with(@post, :add_comment, [["Thanks for sharing this."], {body: "Thanks!"}]) do
153
159
  @post.add_comment(["Thanks for sharing this."], {body: "Thanks!"})
@@ -99,14 +99,18 @@ module Minitest
99
99
  # @post.add_comment("Thanks!")
100
100
  # end
101
101
  #
102
- # assert_called_with(@post, :add_comment, [["Thanks for sharing this."]]) do
102
+ # assert_called_with(@post, :add_comment, [[["Thanks for sharing this."]]]) do
103
103
  # @post.add_comment(["Thanks for sharing this."])
104
104
  # end
105
105
  #
106
- # assert_called_with(@post, :add_comment, [["Thanks for sharing this.", "Thanks!"]]) do
106
+ # assert_called_with(@post, :add_comment, [[["Thanks for sharing this.", "Thanks!"]]]) do
107
107
  # @post.add_comment(["Thanks for sharing this.", "Thanks!"])
108
108
  # end
109
109
  #
110
+ # assert_called_with(@post, :add_comment, [[["Thanks for sharing this."], ["Thanks!"]]]) do
111
+ # @post.add_comment(["Thanks for sharing this."], ["Thanks!"])
112
+ # end
113
+ #
110
114
  # assert_called_with(@post, :add_comment, [["Thanks for sharing this."], {body: "Thanks!"}]) do
111
115
  # @post.add_comment(["Thanks for sharing this."], {body: "Thanks!"})
112
116
  # end
@@ -124,7 +128,7 @@ module Minitest
124
128
  def assert_called_with(object, method_name, arguments, returns: nil)
125
129
  mock = Minitest::Mock.new
126
130
 
127
- if arguments.size > 1 && arguments.all? { |argument| argument.is_a?(Array) }
131
+ if arguments.all? { |argument| argument.is_a?(Array) }
128
132
  arguments.each { |argument| mock.expect(:call, returns, argument) }
129
133
  else
130
134
  mock.expect(:call, returns, arguments)
@@ -1,5 +1,5 @@
1
1
  module Minitest
2
2
  module MockExpectations
3
- VERSION = "1.1.2"
3
+ VERSION = "1.1.3"
4
4
  end
5
5
  end
@@ -147,15 +147,21 @@ class Minitest::MockExpectations::AssertionsTest < Minitest::Test
147
147
  end
148
148
 
149
149
  def test_assert_called_with_an_array_as_expected_argument
150
- assert_called_with(@post, :add_comment, [["Thanks for sharing this."]]) do
150
+ assert_called_with(@post, :add_comment, [[["Thanks for sharing this."]]]) do
151
151
  @post.add_comment(["Thanks for sharing this."])
152
152
  end
153
153
 
154
- assert_called_with(@post, :add_comment, [["Thanks for sharing this.", "Thanks!"]]) do
154
+ assert_called_with(@post, :add_comment, [[["Thanks for sharing this.", "Thanks!"]]]) do
155
155
  @post.add_comment(["Thanks for sharing this.", "Thanks!"])
156
156
  end
157
157
  end
158
158
 
159
+ def test_assert_called_with_expected_arguments_as_arrays
160
+ assert_called_with(@post, :add_comment, [[["Thanks for sharing this."], ["Thanks!"]]]) do
161
+ @post.add_comment(["Thanks for sharing this."], ["Thanks!"])
162
+ end
163
+ end
164
+
159
165
  def test_assert_called_with_multiple_expected_arguments_as_arrays
160
166
  assert_called_with(@post, :add_comment, [[["Thanks for sharing this."]], [["Thanks!"]]]) do
161
167
  @post.add_comment(["Thanks for sharing this."])
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minitest-mock_expectations
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - bogdanvlviv