simple_assertions 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -22,7 +22,9 @@ module SimpleAssertions
22
22
  attributes.each do |attribute, expected|
23
23
  assert_respond_to exception, attribute
24
24
  actual = exception.public_send(attribute)
25
- assert_operator expected, :===, actual
25
+ msg = "Expected #{mu_pp(expected)} to match #{mu_pp(actual)} for #{attribute} on #{mu_pp(exception)}"
26
+ matched = expected == actual || expected === actual
27
+ assert matched, msg
26
28
  end
27
29
  end
28
30
  end
@@ -1,3 +1,3 @@
1
1
  module SimpleAssertions
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
@@ -27,20 +27,26 @@ class SimpleAssertionsAssertRaisesTest < Spec
27
27
  include SimpleAssertions::AssertRaises
28
28
 
29
29
  context :assert_raises do
30
- test "exact param match" do
30
+ test "match param exactly" do
31
31
  assert_raises MyError, :param => "string" do
32
32
  my_error! "string"
33
33
  end
34
34
  end
35
35
 
36
- test "regexp param match" do
36
+ test "match param via regexp" do
37
37
  assert_raises MyError, :param => /string/i do
38
38
  my_error! "my STRING rocks"
39
39
  end
40
40
  end
41
41
 
42
+ test "match param class" do
43
+ assert_raises MyError, :param => MyError do
44
+ my_error! MyError
45
+ end
46
+ end
47
+
42
48
  test "param does not match on === operator" do
43
- assert_raises MiniTest::Assertion, :message => /"foo".*=== "bar"/ do
49
+ assert_raises MiniTest::Assertion, :message => /"foo" to match "bar"/ do
44
50
  assert_raises MyError, :param => "foo" do
45
51
  my_error! "bar"
46
52
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_assertions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -84,9 +84,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
84
84
  - - ! '>='
85
85
  - !ruby/object:Gem::Version
86
86
  version: '0'
87
- segments:
88
- - 0
89
- hash: -188214961
90
87
  requirements: []
91
88
  rubyforge_project:
92
89
  rubygems_version: 1.8.24