spectre-core 1.14.0 → 1.14.1

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: a4bf64674e85ed8358b24a20cb06d453531cb4af450c1670dee4712bcc51fd18
4
- data.tar.gz: 8647deb255849902fc577c846e14c3e03636dde92619915b1d216d78eef9c73c
3
+ metadata.gz: 3ec3e298c4efb325f628370a3855a110136cba4a9d7f870db90d95a5b39c9e8a
4
+ data.tar.gz: fde6391319206d2f8d603b02be31f0f5bb72d424fcb25541b9be0597670ce49a
5
5
  SHA512:
6
- metadata.gz: ab929ce12105b08fb0e0f3180040233c2f748ec6037e71c3b59281083a8a9156b152cb07c0713e56e8d723d2c836671f37a505c6497fae48d7717eeca6008f34
7
- data.tar.gz: acc709c87e6f5d5132f5a5ad01c4478b893479e847a5f38c2edc8fc793d411390bde9173edde3e2712e95258de5056f24511b5a2a67c51378fe39f78f4721e29
6
+ metadata.gz: 5fdb065d1ce08d8c4e78e164bc1caad26ed03d50f4cf6199398699859cb9a81a00260b6e3af785de4a7852aa45da1ae61a2977b0b92bbb5c0c832e6079178cce
7
+ data.tar.gz: ce6b95998d3e3145876bc1d7bb8fe06ce941f1327a6a283557e9944447ffba888c3012124c474d0321f5e9eb91914b53fbdd285255f947db34dd783e084446b5
@@ -10,7 +10,7 @@ module Spectre
10
10
  class ::Object
11
11
  def should_be(value)
12
12
  evaluate(value, "#{self} should be #{value}") do |x|
13
- self.equal? x
13
+ self.to_s == x.to_s
14
14
  end
15
15
  end
16
16
 
@@ -128,7 +128,9 @@ module Spectre
128
128
 
129
129
  class ::String
130
130
  def should_be(val)
131
- raise AssertionFailure.new("'#{self.trim}' should be '#{val.to_s.trim}'", val, self) unless self == val
131
+ evaluate(val, "'#{self}' should be '#{val}'") do |x|
132
+ self.to_s == x.to_s
133
+ end
132
134
  end
133
135
 
134
136
  def should_be_empty
@@ -136,29 +138,37 @@ module Spectre
136
138
  end
137
139
 
138
140
  def should_not_be(val)
139
- raise AssertionFailure.new("'#{self.trim}' should not be '#{val.to_s.trim}'", val, self) unless self != val
141
+ evaluate(value, "'#{self}' should not be '#{value}'") do |x|
142
+ self.to_s != x.to_s
143
+ end
140
144
  end
141
145
 
142
146
  def should_not_be_empty
143
147
  raise AssertionFailure.new('Text should not be empty', 'nothing', self) unless not self.empty?
144
148
  end
145
149
 
146
- def should_contain(value)
147
- evaluate(value, "'#{self.trim}' should contain #{value.to_s}") do |x|
150
+ def should_contain(val)
151
+ evaluate(val, "'#{self.trim}' should contain '#{val.to_s}'") do |x|
148
152
  self.include? x.to_s
149
153
  end
150
154
  end
151
155
 
152
156
  def should_not_contain(val)
153
- raise AssertionFailure.new("'#{self.trim}' should not contain '#{val.trim}'", val, self) if self.include? val
157
+ evaluate(val, "'#{self}' should not contain '#{val}'") do |x|
158
+ not self.include? x.to_s
159
+ end
154
160
  end
155
161
 
156
162
  def should_match(regex)
157
- raise AssertionFailure.new("'#{self.trim}' should match '#{val}'", regex, self) unless self.match(regex)
163
+ evaluate(regex, "'#{self.trim}' should match /#{regex}/") do |x|
164
+ self.match(x)
165
+ end
158
166
  end
159
167
 
160
168
  def should_not_match(regex)
161
- raise AssertionFailure.new("'#{self.trim}' should not match '#{val}'", regex, self) if self.match(regex)
169
+ evaluate(regex, "'#{self.trim}' should not match '#{regex}'") do |x|
170
+ not self.match(x)
171
+ end
162
172
  end
163
173
 
164
174
  alias :| :or
data/lib/spectre.rb CHANGED
@@ -2,7 +2,7 @@ module Spectre
2
2
  module Version
3
3
  MAJOR = 1
4
4
  MINOR = 14
5
- TINY = 0
5
+ TINY = 1
6
6
  end
7
7
 
8
8
  VERSION = [Version::MAJOR, Version::MINOR, Version::TINY].compact * '.'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spectre-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.14.0
4
+ version: 1.14.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christian Neubauer