test_xml 0.1.3 → 0.1.4

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/.gitignore CHANGED
@@ -1,2 +1,13 @@
1
- *.gem
1
+ spec/**/*.xml
2
+ rdoc
3
+ build
4
+ doc
5
+ Rake.config
6
+ pkg
7
+ .project
8
+ .bundle
9
+ Gemfile.lock
2
10
  *.swp
11
+ *.swo
12
+ bin
13
+ *.gem
data/CHANGES.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.1.4
2
+
3
+ * Require bug fix.
4
+
1
5
  ## 0.1.3
2
6
 
3
7
  * Adding support for `MiniTest::Spec` matchers.
@@ -1,4 +1,5 @@
1
1
  require "test_xml"
2
+ require "test_xml/test_unit"
2
3
 
3
4
  MiniTest::Unit::TestCase.class_eval do
4
5
  include TestXml::TestUnit::Assertions
@@ -1,6 +1,33 @@
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
+
4
31
  class Test::Unit::TestCase
5
32
  include TestXml::TestUnit::Assertions
6
- end
33
+ end
@@ -1,3 +1,3 @@
1
1
  module TestXml
2
- VERSION = '0.1.3'
2
+ VERSION = '0.1.4'
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.3
4
+ version: 0.1.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -99,7 +99,6 @@ files:
99
99
  - lib/test_xml/nokogiri/node.rb
100
100
  - lib/test_xml/spec.rb
101
101
  - lib/test_xml/test_unit.rb
102
- - lib/test_xml/test_unit/assertions.rb
103
102
  - lib/test_xml/version.rb
104
103
  - spec/matchers/contain_xml_spec.rb
105
104
  - spec/matchers/contain_xml_structure_spec.rb
@@ -1,26 +0,0 @@
1
- module TestXml
2
- module TestUnit
3
- module Assertions
4
- ASSERTIONS.each do |cfg|
5
- define_method(cfg.assert_name) do |a, b|
6
- correct_assert(MatcherMethods.send(cfg.name, a, b), cfg.message_for_should.call(a, b))
7
- end
8
-
9
- define_method(cfg.assert_not_name) do |a, b|
10
- correct_assert(! MatcherMethods.send(cfg.name, a, b), cfg.message_for_should_not.call(a, b))
11
- end
12
- end
13
-
14
- private
15
- def correct_assert(boolean, message)
16
- if RUBY_VERSION =~ /1.9.2/ or defined?(MiniTest)
17
- assert(boolean, message)
18
- else
19
- assert_block(message) do
20
- boolean
21
- end
22
- end
23
- end
24
- end
25
- end
26
- end