assert_value 1.1 → 1.2
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/README.md +1 -0
- data/assert_value.gemspec +1 -1
- data/lib/assert_value.rb +16 -4
- data/lib/minitest/assert_value_plugin.rb +13 -0
- data/test/assert_value_test.rb +8 -3
- metadata +3 -2
data/README.md
CHANGED
data/assert_value.gemspec
CHANGED
data/lib/assert_value.rb
CHANGED
@@ -1,11 +1,17 @@
|
|
1
1
|
# Copyright (c) 2010-2011 Pluron, Inc.
|
2
|
-
|
2
|
+
|
3
|
+
if defined?(Minitest)
|
4
|
+
# nothing to require, minitest gem is already loaded
|
5
|
+
# it's the only way we can detect Minitest presence
|
6
|
+
else
|
7
|
+
require 'test/unit/testcase'
|
8
|
+
end
|
3
9
|
require 'text_diff'
|
4
10
|
require 'pathname'
|
5
11
|
|
6
12
|
$assert_value_options = []
|
7
13
|
|
8
|
-
if RUBY_VERSION >= "1.9.0"
|
14
|
+
if RUBY_VERSION >= "1.9.0" and !defined?(Minitest) # minitest options are handled by minitest/assert_value_plugin.rb
|
9
15
|
|
10
16
|
# Test/Unit from Ruby 1.9 can't accept additional options like it did in 1.8:
|
11
17
|
# ruby test.rb -- --foo
|
@@ -406,8 +412,14 @@ private
|
|
406
412
|
end
|
407
413
|
|
408
414
|
if RUBY_VERSION >= "1.9.0"
|
409
|
-
|
410
|
-
|
415
|
+
if defined? Minitest::Test
|
416
|
+
class Minitest::Test
|
417
|
+
include AssertValueAssertion
|
418
|
+
end
|
419
|
+
else
|
420
|
+
class MiniTest::Unit::TestCase
|
421
|
+
include AssertValueAssertion
|
422
|
+
end
|
411
423
|
end
|
412
424
|
else
|
413
425
|
class Test::Unit::TestCase
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module Minitest
|
2
|
+
def self.plugin_assert_value_options(opts, options)
|
3
|
+
opts.on '--no-interactive', 'assert_value: non-interactive mode' do |flag|
|
4
|
+
$assert_value_options << "--no-interactive"
|
5
|
+
end
|
6
|
+
opts.on '--no-canonicalize', 'assert_value: turn off canonicalization' do |flag|
|
7
|
+
$assert_value_options << "--no-canonicalize"
|
8
|
+
end
|
9
|
+
opts.on '--autoaccept', 'assert_value: automatically accept new actual values' do |flag|
|
10
|
+
$assert_value_options << "--autoaccept"
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
data/test/assert_value_test.rb
CHANGED
@@ -1,9 +1,14 @@
|
|
1
1
|
# Copyright (c) 2011 Pluron, Inc.
|
2
2
|
|
3
|
-
|
3
|
+
begin
|
4
|
+
require 'minitest/autorun'
|
5
|
+
rescue LoadError
|
6
|
+
require 'test/unit'
|
7
|
+
end
|
8
|
+
|
4
9
|
require 'assert_value'
|
5
10
|
|
6
|
-
class AssertValueTest < Test::Unit::TestCase
|
11
|
+
class AssertValueTest < ( defined?(Minitest) ? Minitest::Test : Test::Unit::TestCase )
|
7
12
|
|
8
13
|
def test_basic_assert_value
|
9
14
|
assert_value "foo", <<-END
|
@@ -88,7 +93,7 @@ end
|
|
88
93
|
|
89
94
|
if RUBY_VERSION >= "1.9.0"
|
90
95
|
|
91
|
-
class AssertValueMiniTest < MiniTest::Unit::TestCase
|
96
|
+
class AssertValueMiniTest < (defined?(Minitest) ? Minitest::Test : MiniTest::Unit::TestCase)
|
92
97
|
|
93
98
|
def test_basic_assert_value
|
94
99
|
assert_value "foo", <<-END
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: assert_value
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '1.
|
4
|
+
version: '1.2'
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2014-04-17 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: assert_value assertion
|
15
15
|
email: support@pluron.com
|
@@ -26,6 +26,7 @@ files:
|
|
26
26
|
- assert_value.kdev4
|
27
27
|
- lib/array_diff.rb
|
28
28
|
- lib/assert_value.rb
|
29
|
+
- lib/minitest/assert_value_plugin.rb
|
29
30
|
- lib/text_diff.rb
|
30
31
|
- test/assert_value_spec.rb
|
31
32
|
- test/assert_value_test.rb
|