must_be 1.0.3 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,7 +10,7 @@ describe MustBe do
10
10
  it "should raise ArgumentError" do
11
11
  expect do
12
12
  Proxy.new(:moxie, :must_could)
13
- end.should raise_error(ArgumentError,
13
+ end.to raise_error(ArgumentError,
14
14
  "assertion (:must_could) must be :must or :must_not")
15
15
  end
16
16
  end
@@ -95,16 +95,16 @@ describe MustBe do
95
95
  subject.between?(-4, 4)
96
96
  end
97
97
 
98
- it_should_notify("230579.must.respond_to?(:finite?)") do
99
- subject.respond_to? :finite?
98
+ it_should_notify("230579.must.respond_to?(:nan?)") do
99
+ subject.respond_to? :nan?
100
100
  end
101
101
 
102
- it_should_not_notify("230579.must.instance_of?(Fixnum)") do
103
- subject.instance_of? Fixnum
102
+ it_should_not_notify("230579.must.instance_of?(Integer)") do
103
+ subject.instance_of? Integer
104
104
  end
105
105
 
106
- it_should_notify("230579.must.instance_of?(Integer)") do
107
- subject.instance_of? Integer
106
+ it_should_notify("230579.must.instance_of?(Float)") do
107
+ subject.instance_of? Float
108
108
  end
109
109
 
110
110
  it "should have a different #object_id" do
@@ -176,17 +176,17 @@ describe MustBe do
176
176
  end
177
177
 
178
178
  it_should_not_notify(
179
- "230579.must_not.respond_to?(:finite?)") do
180
- subject.respond_to? :finite?
179
+ "230579.must_not.respond_to?(:nan?)") do
180
+ subject.respond_to? :nan?
181
181
  end
182
182
 
183
- it_should_notify("230579.must_not.instance_of?(Fixnum)") do
184
- subject.instance_of? Fixnum
183
+ it_should_notify("230579.must_not.instance_of?(Integer)") do
184
+ subject.instance_of? Integer
185
185
  end
186
186
 
187
187
  it_should_not_notify(
188
- "230579.must_not.instance_of?(Integer)") do
189
- subject.instance_of? Integer
188
+ "230579.must_not.instance_of?(Float)") do
189
+ subject.instance_of? Float
190
190
  end
191
191
  end
192
192
  end
@@ -38,7 +38,7 @@ describe "Notify Matcher" do
38
38
  it "should raise ArgumentError" do
39
39
  expect do
40
40
  :it.should notify("one", "two")
41
- end.should raise_error(ArgumentError,
41
+ end.to raise_error(ArgumentError,
42
42
  "wrong number of arguments (2 for 1)")
43
43
  end
44
44
  end
@@ -55,7 +55,15 @@ end
55
55
 
56
56
  ### MustBeExampleHelper ###
57
57
 
58
- require 'rspec'
58
+ require 'rspec/its'
59
+
60
+ # Some old syntax.
61
+ RSpec.configure do |config|
62
+ config.expect_with(:rspec){|c| c.syntax = [:should, :expect]}
63
+ end
64
+
65
+ # Some old semantics.
66
+ RSpec::Expectations.configuration.on_potential_false_positives = :nothing
59
67
 
60
68
  module MustBeExampleHelper
61
69
 
@@ -189,11 +197,11 @@ module MustBeExampleHelper
189
197
  end
190
198
  end
191
199
 
192
- failure_message_for_should do |given|
200
+ failure_message do |given|
193
201
  @message
194
202
  end
195
203
 
196
- failure_message_for_should_not do |given|
204
+ failure_message_when_negated do |given|
197
205
  @message
198
206
  end
199
207
  end
@@ -8,7 +8,7 @@ describe MustBe, " typical usage" do
8
8
  context "when called with a Class, it notifies unless"\
9
9
  " receiver.is_a? Class" do
10
10
  notify_example %{4.must_be(Numeric)}
11
- notify_example %{4.must_be(Float)}, Fixnum
11
+ notify_example %{4.must_be(Float)}, Integer
12
12
  end
13
13
 
14
14
  context "when called with a regexp, it notifies unless"\
@@ -20,13 +20,13 @@ describe MustBe, " typical usage" do
20
20
  context "when called with a range, it notifies unless"\
21
21
  " range.include? receiver" do
22
22
  notify_example %{5.must_be(1..5)}
23
- notify_example %{5.must_be(1...5)}, Fixnum
23
+ notify_example %{5.must_be(1...5)}, Integer
24
24
  end
25
25
 
26
26
  context "when called with an array, it notifies unless"\
27
27
  " array == receiver" do
28
28
  notify_example %{[3, 5].must_be([3, 5])}
29
- notify_example %{3.must_be([3, 5])}, Fixnum
29
+ notify_example %{3.must_be([3, 5])}, Integer
30
30
  end
31
31
 
32
32
  context "when called with a proc, it notifies unless proc[receiver]" do
@@ -50,7 +50,7 @@ describe MustBe, " typical usage" do
50
50
  context "when called with multiple arguments, it notifies unless"\
51
51
  " receiver case-equals (===) one of them" do
52
52
  notify_example %{:happy.must_be(String, Symbol)}
53
- notify_example %{934.must_be(String, Symbol)}, Fixnum
53
+ notify_example %{934.must_be(String, Symbol)}, Integer
54
54
  end
55
55
  end
56
56
 
@@ -169,7 +169,7 @@ describe MustBe, " typical usage" do
169
169
  end) do |note|
170
170
  did_call_block = true
171
171
  end
172
- did_call_block.should be_false
172
+ did_call_block.should be false
173
173
  end
174
174
  end
175
175
  end
metadata CHANGED
@@ -1,65 +1,56 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: must_be
3
- version: !ruby/object:Gem::Version
4
- hash: 17
5
- prerelease: false
6
- segments:
7
- - 1
8
- - 0
9
- - 3
10
- version: 1.0.3
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.1.0
11
5
  platform: ruby
12
- authors:
6
+ authors:
13
7
  - William Taysom
14
8
  autorequire:
15
9
  bindir: bin
16
10
  cert_chain: []
17
-
18
- date: 2010-11-01 00:00:00 +08:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
22
- name: jeweler
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ~>
28
- - !ruby/object:Gem::Version
29
- hash: 7
30
- segments:
31
- - 1
32
- - 4
33
- version: "1.4"
11
+ date: 2018-05-22 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rspec-its
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.2'
34
20
  type: :development
35
- version_requirements: *id001
36
- - !ruby/object:Gem::Dependency
37
- name: rspec
38
21
  prerelease: false
39
- requirement: &id002 !ruby/object:Gem::Requirement
40
- none: false
41
- requirements:
42
- - - ~>
43
- - !ruby/object:Gem::Version
44
- hash: 3
45
- segments:
46
- - 2
47
- - 0
48
- version: "2.0"
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.2'
27
+ - !ruby/object:Gem::Dependency
28
+ name: jeweler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.4'
49
34
  type: :development
50
- version_requirements: *id002
51
- description: must_be provides runtime assertions which can easily be disabled in production environments. Likewise, the notifier can be customized to raise errors, log failure, enter the debugger, or anything else.
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.4'
41
+ description: must_be provides runtime assertions which can easily be disabled in production
42
+ environments. Likewise, the notifier can be customized to raise errors, log failure,
43
+ enter the debugger, or anything else.
52
44
  email: wtaysom@gmail.com
53
45
  executables: []
54
-
55
46
  extensions: []
56
-
57
- extra_rdoc_files:
47
+ extra_rdoc_files:
58
48
  - ChangeLog.md
59
49
  - README.md
60
- files:
61
- - .gitignore
50
+ files:
62
51
  - ChangeLog.md
52
+ - Gemfile
53
+ - Gemfile.lock
63
54
  - README.md
64
55
  - Rakefile
65
56
  - VERSION
@@ -83,47 +74,27 @@ files:
83
74
  - spec/notify_matcher_spec.rb
84
75
  - spec/spec_helper.rb
85
76
  - spec/typical_usage_spec.rb
86
- has_rdoc: true
87
77
  homepage: http://github.com/wtaysom/must_be
88
78
  licenses: []
89
-
79
+ metadata: {}
90
80
  post_install_message:
91
- rdoc_options:
92
- - --charset=UTF-8
93
- require_paths:
81
+ rdoc_options: []
82
+ require_paths:
94
83
  - lib
95
- required_ruby_version: !ruby/object:Gem::Requirement
96
- none: false
97
- requirements:
84
+ required_ruby_version: !ruby/object:Gem::Requirement
85
+ requirements:
98
86
  - - ">="
99
- - !ruby/object:Gem::Version
100
- hash: 3
101
- segments:
102
- - 0
103
- version: "0"
104
- required_rubygems_version: !ruby/object:Gem::Requirement
105
- none: false
106
- requirements:
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ required_rubygems_version: !ruby/object:Gem::Requirement
90
+ requirements:
107
91
  - - ">="
108
- - !ruby/object:Gem::Version
109
- hash: 3
110
- segments:
111
- - 0
112
- version: "0"
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
113
94
  requirements: []
114
-
115
95
  rubyforge_project:
116
- rubygems_version: 1.3.7
96
+ rubygems_version: 2.7.3
117
97
  signing_key:
118
- specification_version: 3
98
+ specification_version: 4
119
99
  summary: must_be Runtime Assertions
120
- test_files:
121
- - spec/must_be/attr_typed_spec.rb
122
- - spec/must_be/basic_spec.rb
123
- - spec/must_be/containers_spec.rb
124
- - spec/must_be/core_spec.rb
125
- - spec/must_be/nonstandard_control_flow_spec.rb
126
- - spec/must_be/proxy_spec.rb
127
- - spec/notify_matcher_spec.rb
128
- - spec/spec_helper.rb
129
- - spec/typical_usage_spec.rb
100
+ test_files: []
data/.gitignore DELETED
@@ -1,2 +0,0 @@
1
- pkg/
2
- coverage/