assert_value 1.5.4 → 1.5.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/workflows/ci.yml +77 -0
- data/README.md +5 -0
- data/assert_value.gemspec +2 -2
- data/lib/assert_value.rb +12 -6
- data/test/assert_value_test.rb +25 -0
- metadata +5 -6
- data/.travis.yml +0 -67
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 63e54287cd84fc8b19b2d759629c812c019a39f0bcf3e32300ef237c762cac39
|
4
|
+
data.tar.gz: b37e613cdee6a56e723ce3123f09be69de333809c1896e79cbf163f3703b1966
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d1777da3bd3564c49d88c51687bca77caea69fd97c39a71de8e9be2018f0e0614fe13f39ba00c018d79940f1a789acbbfe44852c96a67b2592542ebe0db1bea0
|
7
|
+
data.tar.gz: 01cdc978fc0cfbfccd4a6f96da533e8ec59a5302379fd7d258b48a87bb048289821a91576d4de95816a2d0628c17f565f67380b0ab7ffa415d60831a483fcfc3
|
@@ -0,0 +1,77 @@
|
|
1
|
+
name: CI
|
2
|
+
on:
|
3
|
+
pull_request:
|
4
|
+
push:
|
5
|
+
branches:
|
6
|
+
- '**'
|
7
|
+
jobs:
|
8
|
+
test:
|
9
|
+
strategy:
|
10
|
+
fail-fast: false
|
11
|
+
matrix:
|
12
|
+
include:
|
13
|
+
- ruby: 1.9.3
|
14
|
+
gemfile: gemfiles/minitest.bundled.gemfile
|
15
|
+
os: ubuntu-20.04
|
16
|
+
- ruby: 1.9.3
|
17
|
+
gemfile: gemfiles/rspec.2.99.gemfile
|
18
|
+
script: bundle exec rspec test
|
19
|
+
os: ubuntu-20.04
|
20
|
+
- ruby: 1.9.3
|
21
|
+
gemfile: gemfiles/rspec.latest.gemfile
|
22
|
+
script: bundle exec rake spec
|
23
|
+
os: ubuntu-20.04
|
24
|
+
- ruby: 2.2.10
|
25
|
+
gemfile: gemfiles/test-unit.latest.gemfile
|
26
|
+
script: bundle exec rake test
|
27
|
+
os: ubuntu-20.04
|
28
|
+
- ruby: 2.2.10
|
29
|
+
gemfile: gemfiles/minitest.latest.gemfile
|
30
|
+
script: bundle exec rake test
|
31
|
+
os: ubuntu-20.04
|
32
|
+
- ruby: 2.2.10
|
33
|
+
gemfile: gemfiles/rspec.latest.gemfile
|
34
|
+
script: bundle exec rake spec
|
35
|
+
os: ubuntu-20.04
|
36
|
+
- ruby: 2.3.8
|
37
|
+
gemfile: gemfiles/test-unit.latest.gemfile
|
38
|
+
script: bundle exec rake test
|
39
|
+
os: ubuntu-22.04
|
40
|
+
- ruby: 2.3.8
|
41
|
+
gemfile: gemfiles/minitest.latest.gemfile
|
42
|
+
script: bundle exec rake test
|
43
|
+
os: ubuntu-22.04
|
44
|
+
- ruby: 2.3.8
|
45
|
+
gemfile: gemfiles/rspec.latest.gemfile
|
46
|
+
script: bundle exec rake spec
|
47
|
+
os: ubuntu-22.04
|
48
|
+
- ruby: 2.5.7
|
49
|
+
gemfile: gemfiles/test-unit.latest.gemfile
|
50
|
+
script: bundle exec rake test
|
51
|
+
os: ubuntu-22.04
|
52
|
+
- ruby: 2.5.7
|
53
|
+
gemfile: gemfiles/minitest.latest.gemfile
|
54
|
+
script: bundle exec rake test
|
55
|
+
os: ubuntu-22.04
|
56
|
+
- ruby: 2.5.7
|
57
|
+
gemfile: gemfiles/rspec.latest.gemfile
|
58
|
+
script: bundle exec rake spec
|
59
|
+
os: ubuntu-22.04
|
60
|
+
- ruby: 3.2.2
|
61
|
+
gemfile: gemfiles/minitest.latest.gemfile
|
62
|
+
script: bundle exec rake test
|
63
|
+
os: ubuntu-22.04
|
64
|
+
- ruby: 3.2.2
|
65
|
+
gemfile: gemfiles/rspec.latest.gemfile
|
66
|
+
script: bundle exec rake spec
|
67
|
+
os: ubuntu-22.04
|
68
|
+
runs-on: "${{ matrix.os }}"
|
69
|
+
env:
|
70
|
+
BUNDLE_GEMFILE: "${{ matrix.gemfile }}"
|
71
|
+
steps:
|
72
|
+
- uses: actions/checkout@v4
|
73
|
+
- uses: ruby/setup-ruby@v1
|
74
|
+
with:
|
75
|
+
ruby-version: ${{ matrix.ruby }}
|
76
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
77
|
+
- run: "${{ matrix.script }}"
|
data/README.md
CHANGED
@@ -9,6 +9,11 @@ Support two kind of arguments: string and code block.
|
|
9
9
|
|
10
10
|
This check works with both Test/Unit and RSpec. See documentation and examples below:
|
11
11
|
|
12
|
+
# Screencast
|
13
|
+
|
14
|
+
![Screencast](https://github.com/assert-value/assert_value_screencasts/raw/master/screencast_10fps.gif)
|
15
|
+
|
16
|
+
|
12
17
|
## Testing String Values
|
13
18
|
|
14
19
|
It is better to start with no expected value
|
data/assert_value.gemspec
CHANGED
@@ -2,10 +2,10 @@ require 'rubygems'
|
|
2
2
|
|
3
3
|
SPEC = Gem::Specification.new do |s|
|
4
4
|
s.name = "assert_value"
|
5
|
-
s.version = "1.5.
|
5
|
+
s.version = "1.5.6"
|
6
6
|
s.author = "Pluron, Inc."
|
7
7
|
s.email = "support@pluron.com"
|
8
|
-
s.homepage = "
|
8
|
+
s.homepage = "https://github.com/assert-value/assert_value_ruby"
|
9
9
|
s.platform = Gem::Platform::RUBY
|
10
10
|
s.license = 'MIT'
|
11
11
|
s.description = "assert_value assertion"
|
data/lib/assert_value.rb
CHANGED
@@ -293,9 +293,12 @@ private
|
|
293
293
|
end
|
294
294
|
|
295
295
|
def soft_fail(diff)
|
296
|
-
|
296
|
+
case ASSERT_VALUE_TEST_FRAMEWORK
|
297
|
+
when :old_minitest then
|
297
298
|
failure = MiniTest::Assertion.new(diff)
|
298
|
-
|
299
|
+
when :new_minitest then
|
300
|
+
failure = Minitest::Assertion.new(diff)
|
301
|
+
when :rspec_only then
|
299
302
|
failure = diff
|
300
303
|
else
|
301
304
|
failure = Test::Unit::Failure.new(name, filter_backtrace(caller(0)), diff)
|
@@ -305,8 +308,11 @@ private
|
|
305
308
|
|
306
309
|
def fail(diff)
|
307
310
|
increment_assertion_count
|
308
|
-
|
311
|
+
case ASSERT_VALUE_TEST_FRAMEWORK
|
312
|
+
when :old_minitest then
|
309
313
|
raise MiniTest::Assertion.new(diff)
|
314
|
+
when :new_minitest then
|
315
|
+
raise Minitest::Assertion.new(diff)
|
310
316
|
else
|
311
317
|
raise Test::Unit::AssertionFailedError.new(diff)
|
312
318
|
end
|
@@ -397,11 +403,11 @@ private
|
|
397
403
|
# ignore leading newlines if any (trailing will be automatically ignored by split())
|
398
404
|
result.delete_at(0) if result[0] == ""
|
399
405
|
|
400
|
-
indentation =
|
406
|
+
indentation = result.map{|line| line =~ /^(\s+)/ ? $1.length : 0}.min
|
401
407
|
|
402
408
|
result.map! do |line|
|
403
|
-
# ignore indentation
|
404
|
-
line.gsub!(/^\s{#{indentation}}/, '') if indentation
|
409
|
+
# ignore indentation
|
410
|
+
line.gsub!(/^\s{#{indentation}}/, '') if indentation > 0
|
405
411
|
# ignore trailing spaces
|
406
412
|
line.gsub(/\s*$/, '')
|
407
413
|
end
|
data/test/assert_value_test.rb
CHANGED
@@ -111,4 +111,29 @@ class AssertValueTest < test_case_class
|
|
111
111
|
END
|
112
112
|
end
|
113
113
|
|
114
|
+
def test_indentation
|
115
|
+
indented = " foo\n bar"
|
116
|
+
assert_value indented, <<-END
|
117
|
+
foo
|
118
|
+
bar
|
119
|
+
END
|
120
|
+
end
|
121
|
+
|
122
|
+
if ASSERT_VALUE_TEST_FRAMEWORK == :new_minitest
|
123
|
+
def test_soft_fail
|
124
|
+
assert_value(<<-END) do
|
125
|
+
Exception Minitest::Assertion: @@ -1,1, +1,1 @@
|
126
|
+
-bar
|
127
|
+
+foo
|
128
|
+
END
|
129
|
+
$assert_value_options.push("--no-interactive")
|
130
|
+
begin
|
131
|
+
assert_value "foo", "bar"
|
132
|
+
ensure
|
133
|
+
$assert_value_options.pop
|
134
|
+
end
|
135
|
+
end
|
136
|
+
end
|
137
|
+
end
|
138
|
+
|
114
139
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: assert_value
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pluron, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-10-30 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: assert_value assertion
|
14
14
|
email: support@pluron.com
|
@@ -16,8 +16,8 @@ executables: []
|
|
16
16
|
extensions: []
|
17
17
|
extra_rdoc_files: []
|
18
18
|
files:
|
19
|
+
- ".github/workflows/ci.yml"
|
19
20
|
- ".gitignore"
|
20
|
-
- ".travis.yml"
|
21
21
|
- LICENSE
|
22
22
|
- README.md
|
23
23
|
- Rakefile
|
@@ -37,7 +37,7 @@ files:
|
|
37
37
|
- test/assert_value_test.rb
|
38
38
|
- test/logs/assert_value_exception_with_files.log.ref
|
39
39
|
- test/logs/assert_value_with_files.log.ref
|
40
|
-
homepage:
|
40
|
+
homepage: https://github.com/assert-value/assert_value_ruby
|
41
41
|
licenses:
|
42
42
|
- MIT
|
43
43
|
metadata: {}
|
@@ -56,8 +56,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
56
56
|
- !ruby/object:Gem::Version
|
57
57
|
version: '0'
|
58
58
|
requirements: []
|
59
|
-
|
60
|
-
rubygems_version: 2.5.1
|
59
|
+
rubygems_version: 3.1.6
|
61
60
|
signing_key:
|
62
61
|
specification_version: 4
|
63
62
|
summary: Assert that checks that two values (strings, expected and actual) are same
|
data/.travis.yml
DELETED
@@ -1,67 +0,0 @@
|
|
1
|
-
# use containter-based infastructured
|
2
|
-
# intended to fix:
|
3
|
-
# NoMethodError: undefined method `spec' for nil:NilClass
|
4
|
-
# https://github.com/bundler/bundler/issues/3558
|
5
|
-
sudo: false
|
6
|
-
|
7
|
-
language: ruby
|
8
|
-
|
9
|
-
rvm:
|
10
|
-
- 1.8.7
|
11
|
-
- 1.9.3
|
12
|
-
- 2.2.6
|
13
|
-
- 2.3.3
|
14
|
-
- 2.4.1
|
15
|
-
|
16
|
-
matrix:
|
17
|
-
# Do not run tests with default Gemfile. We don't have it
|
18
|
-
exclude:
|
19
|
-
- rvm: 1.8.7
|
20
|
-
- rvm: 1.9.3
|
21
|
-
- rvm: 2.2.6
|
22
|
-
- rvm: 2.3.3
|
23
|
-
- rvm: 2.4.1
|
24
|
-
include:
|
25
|
-
- rvm: 1.8.7
|
26
|
-
gemfile: gemfiles/test-unit.bundled.gemfile
|
27
|
-
- rvm: 1.8.7
|
28
|
-
gemfile: gemfiles/rspec.2.99.gemfile
|
29
|
-
script: bundle exec rspec test
|
30
|
-
- rvm: 1.8.7
|
31
|
-
gemfile: gemfiles/rspec.latest.gemfile
|
32
|
-
script: bundle exec rake spec
|
33
|
-
- rvm: 1.9.3
|
34
|
-
gemfile: gemfiles/minitest.bundled.gemfile
|
35
|
-
- rvm: 1.9.3
|
36
|
-
gemfile: gemfiles/rspec.2.99.gemfile
|
37
|
-
script: bundle exec rspec test
|
38
|
-
- rvm: 1.9.3
|
39
|
-
gemfile: gemfiles/rspec.latest.gemfile
|
40
|
-
script: bundle exec rake spec
|
41
|
-
- rvm: 2.2.6
|
42
|
-
gemfile: gemfiles/test-unit.latest.gemfile
|
43
|
-
script: bundle exec rake test
|
44
|
-
- rvm: 2.2.6
|
45
|
-
gemfile: gemfiles/minitest.latest.gemfile
|
46
|
-
script: bundle exec rake test
|
47
|
-
- rvm: 2.2.6
|
48
|
-
gemfile: gemfiles/rspec.latest.gemfile
|
49
|
-
script: bundle exec rake spec
|
50
|
-
- rvm: 2.3.3
|
51
|
-
gemfile: gemfiles/test-unit.latest.gemfile
|
52
|
-
script: bundle exec rake test
|
53
|
-
- rvm: 2.3.3
|
54
|
-
gemfile: gemfiles/minitest.latest.gemfile
|
55
|
-
script: bundle exec rake test
|
56
|
-
- rvm: 2.3.3
|
57
|
-
gemfile: gemfiles/rspec.latest.gemfile
|
58
|
-
script: bundle exec rake spec
|
59
|
-
- rvm: 2.4.1
|
60
|
-
gemfile: gemfiles/test-unit.latest.gemfile
|
61
|
-
script: bundle exec rake test
|
62
|
-
- rvm: 2.4.1
|
63
|
-
gemfile: gemfiles/minitest.latest.gemfile
|
64
|
-
script: bundle exec rake test
|
65
|
-
- rvm: 2.4.1
|
66
|
-
gemfile: gemfiles/rspec.latest.gemfile
|
67
|
-
script: bundle exec rake spec
|