test_xml 0.1.5 → 0.1.6

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.
data/CHANGES.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 0.1.6
2
+
3
+ * Fix dependencies so that Minitest doesn't rely on Test::Unit anymore. If you having trouble, update to minitest > 4.0.0 :)
4
+
1
5
  # 0.1.5
2
6
 
3
7
  * Make minitest-5 compatible.
@@ -41,4 +41,27 @@ module TestXml
41
41
  :message_for_should_not => lambda { |a,b| "the xml:\n#{a}\nshould not exactly match xml structure:\n#{b} but it does" }
42
42
  )
43
43
  ]
44
+
45
+ module Assertions
46
+ ASSERTIONS.each do |cfg|
47
+ define_method(cfg.assert_name) do |a, b|
48
+ correct_assert(MatcherMethods.send(cfg.name, a, b), cfg.message_for_should.call(a, b))
49
+ end
50
+
51
+ define_method(cfg.assert_not_name) do |a, b|
52
+ correct_assert(! MatcherMethods.send(cfg.name, a, b), cfg.message_for_should_not.call(a, b))
53
+ end
54
+ end
55
+
56
+ private
57
+ def correct_assert(boolean, message)
58
+ if RUBY_VERSION =~ /1.9.2/ or defined?(MiniTest)
59
+ assert(boolean, message)
60
+ else
61
+ assert_block(message) do
62
+ boolean
63
+ end
64
+ end
65
+ end
66
+ end
44
67
  end
@@ -1,5 +1,4 @@
1
1
  require "test_xml"
2
- require "test_xml/test_unit"
3
2
 
4
3
  # TODO: should we remove test_xml/spec?
5
4
  MiniTest::Expectations.class_eval do
@@ -9,5 +8,5 @@ MiniTest::Expectations.class_eval do
9
8
  end
10
9
 
11
10
  class MiniTest::Test
12
- include TestXml::TestUnit::Assertions
11
+ include TestXml::Assertions
13
12
  end
@@ -1,33 +1,6 @@
1
1
  require "test/unit"
2
2
  require "test_xml"
3
3
 
4
- module TestXml
5
- module TestUnit
6
- module Assertions
7
- ASSERTIONS.each do |cfg|
8
- define_method(cfg.assert_name) do |a, b|
9
- correct_assert(MatcherMethods.send(cfg.name, a, b), cfg.message_for_should.call(a, b))
10
- end
11
-
12
- define_method(cfg.assert_not_name) do |a, b|
13
- correct_assert(! MatcherMethods.send(cfg.name, a, b), cfg.message_for_should_not.call(a, b))
14
- end
15
- end
16
-
17
- private
18
- def correct_assert(boolean, message)
19
- if RUBY_VERSION =~ /1.9.2/ or defined?(MiniTest)
20
- assert(boolean, message)
21
- else
22
- assert_block(message) do
23
- boolean
24
- end
25
- end
26
- end
27
- end
28
- end
29
- end
30
-
31
4
  class Test::Unit::TestCase
32
- include TestXml::TestUnit::Assertions
5
+ include TestXml::Assertions
33
6
  end
@@ -1,3 +1,3 @@
1
1
  module TestXml
2
- VERSION = '0.1.5'
2
+ VERSION = '0.1.6'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: test_xml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
OSZAR »