matchi 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +4 -1
- data/VERSION.semver +1 -1
- data/matchi.gemspec +2 -2
- metadata +2 -12
- data/test/support/coverage.rb +0 -3
- data/test/test_be_false.rb +0 -8
- data/test/test_be_nil.rb +0 -8
- data/test/test_be_the_answer.rb +0 -25
- data/test/test_be_true.rb +0 -8
- data/test/test_constants.rb +0 -11
- data/test/test_eql.rb +0 -8
- data/test/test_equal.rb +0 -8
- data/test/test_match.rb +0 -8
- data/test/test_raise_exception.rb +0 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 102ebbc39b1ade97fecca2a7fd45dbd298a8a4e6
|
4
|
+
data.tar.gz: 65198cc28f313e3c89dd2b0a7e81caa1a75de2a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a605883889e08a47effac8d159170d7557f087d9a541e4a0fa3f72cc077e2bea578341ff77209b30c942a84ab03ce8a45b7993afc0fa11af2324cbccf69818ee
|
7
|
+
data.tar.gz: 02c3171d3351bff5d9b138036ad47d8d9f9a6423e11b7a30cd4580468830f024ebf1da0e740e2aa0b9e9d692c751a5a75463a2b7d40939d796a30fd67824799c
|
data/Rakefile
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
require 'bundler/gem_tasks'
|
2
2
|
require 'rake/testtask'
|
3
|
+
require 'rubocop/rake_task'
|
4
|
+
|
5
|
+
RuboCop::RakeTask.new
|
3
6
|
|
4
7
|
Rake::TestTask.new do |t|
|
5
8
|
t.verbose = true
|
@@ -14,4 +17,4 @@ namespace :test do
|
|
14
17
|
end
|
15
18
|
|
16
19
|
task(:doc_stats) { ruby '-S yard stats' }
|
17
|
-
task default:
|
20
|
+
task default: %i(test doc_stats rubocop)
|
data/VERSION.semver
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.7
|
data/matchi.gemspec
CHANGED
@@ -10,8 +10,8 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.license = 'MIT'
|
11
11
|
|
12
12
|
spec.files =
|
13
|
-
`git ls-files -z`.split("\x0").reject { |f| f.match(
|
14
|
-
spec.executables = spec.files.grep(
|
13
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^test/}) }
|
14
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
15
15
|
spec.require_paths = ['lib']
|
16
16
|
|
17
17
|
spec.add_development_dependency 'bundler', '~> 1.9'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: matchi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cyril Wack
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -107,16 +107,6 @@ files:
|
|
107
107
|
- lib/matchi/match.rb
|
108
108
|
- lib/matchi/raise_exception.rb
|
109
109
|
- matchi.gemspec
|
110
|
-
- test/support/coverage.rb
|
111
|
-
- test/test_be_false.rb
|
112
|
-
- test/test_be_nil.rb
|
113
|
-
- test/test_be_the_answer.rb
|
114
|
-
- test/test_be_true.rb
|
115
|
-
- test/test_constants.rb
|
116
|
-
- test/test_eql.rb
|
117
|
-
- test/test_equal.rb
|
118
|
-
- test/test_match.rb
|
119
|
-
- test/test_raise_exception.rb
|
120
110
|
homepage: https://github.com/fixrb/matchi
|
121
111
|
licenses:
|
122
112
|
- MIT
|
data/test/support/coverage.rb
DELETED
data/test/test_be_false.rb
DELETED
@@ -1,8 +0,0 @@
|
|
1
|
-
require_relative File.join 'support', 'coverage'
|
2
|
-
require_relative File.join '..', 'lib', 'matchi'
|
3
|
-
|
4
|
-
# It is expected to be true
|
5
|
-
fail unless Matchi.fetch(:BeFalse).matches? { false }
|
6
|
-
|
7
|
-
# It is expected to be false
|
8
|
-
fail if Matchi.fetch(:BeFalse).matches? { 'foo' }
|
data/test/test_be_nil.rb
DELETED
@@ -1,8 +0,0 @@
|
|
1
|
-
require_relative File.join 'support', 'coverage'
|
2
|
-
require_relative File.join '..', 'lib', 'matchi'
|
3
|
-
|
4
|
-
# It is expected to be true
|
5
|
-
fail unless Matchi.fetch(:BeNil).matches? { nil }
|
6
|
-
|
7
|
-
# It is expected to be false
|
8
|
-
fail if Matchi.fetch(:BeNil).matches? { 'foo' }
|
data/test/test_be_the_answer.rb
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
require_relative File.join 'support', 'coverage'
|
2
|
-
require_relative File.join '..', 'lib', 'matchi'
|
3
|
-
|
4
|
-
module Matchi
|
5
|
-
# **Answer to the Ultimate Question of Life, The Universe, and Everything**
|
6
|
-
# matcher.
|
7
|
-
class BeTheAnswer
|
8
|
-
# @example Is it 42?
|
9
|
-
# be_the_answer = Matchi::BeTheAnswer.new
|
10
|
-
# be_the_answer.matches? { 42 } # => true
|
11
|
-
#
|
12
|
-
# @yieldreturn [#object_id] the actual value to compare to the expected one.
|
13
|
-
#
|
14
|
-
# @return [Boolean] Comparison between actual and expected values.
|
15
|
-
def matches?
|
16
|
-
42.equal? yield
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
# It is expected to be true
|
22
|
-
fail unless Matchi.fetch(:BeTheAnswer).matches? { 42 }
|
23
|
-
|
24
|
-
# It is expected to be false
|
25
|
-
fail if Matchi.fetch(:BeTheAnswer).matches? { 4 }
|
data/test/test_be_true.rb
DELETED
@@ -1,8 +0,0 @@
|
|
1
|
-
require_relative File.join 'support', 'coverage'
|
2
|
-
require_relative File.join '..', 'lib', 'matchi'
|
3
|
-
|
4
|
-
# It is expected to be true
|
5
|
-
fail unless Matchi.fetch(:BeTrue).matches? { true }
|
6
|
-
|
7
|
-
# It is expected to be false
|
8
|
-
fail if Matchi.fetch(:BeTrue).matches? { 'foo' }
|
data/test/test_constants.rb
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
require_relative File.join 'support', 'coverage'
|
2
|
-
require_relative File.join '..', 'lib', 'matchi'
|
3
|
-
|
4
|
-
# It is expected to be true
|
5
|
-
module Matchi
|
6
|
-
class Foo; end
|
7
|
-
end
|
8
|
-
|
9
|
-
fail unless Matchi.constants.to_set.superset? [
|
10
|
-
:BeFalse, :BeNil, :BeTrue, :Eql, :Equal, :Match, :RaiseException
|
11
|
-
].to_set
|
data/test/test_eql.rb
DELETED
@@ -1,8 +0,0 @@
|
|
1
|
-
require_relative File.join 'support', 'coverage'
|
2
|
-
require_relative File.join '..', 'lib', 'matchi'
|
3
|
-
|
4
|
-
# It is expected to be true
|
5
|
-
fail unless Matchi.fetch(:Eql, 'foo').matches? { 'foo' }
|
6
|
-
|
7
|
-
# It is expected to be false
|
8
|
-
fail if Matchi.fetch(:Eql, 'foo').matches? { 'bar' }
|
data/test/test_equal.rb
DELETED
@@ -1,8 +0,0 @@
|
|
1
|
-
require_relative File.join 'support', 'coverage'
|
2
|
-
require_relative File.join '..', 'lib', 'matchi'
|
3
|
-
|
4
|
-
# It is expected to be true
|
5
|
-
fail unless Matchi.fetch(:Equal, :foo).matches? { :foo }
|
6
|
-
|
7
|
-
# It is expected to be false
|
8
|
-
fail if Matchi.fetch(:Equal, :foo).matches? { :bar }
|
data/test/test_match.rb
DELETED
@@ -1,8 +0,0 @@
|
|
1
|
-
require_relative File.join 'support', 'coverage'
|
2
|
-
require_relative File.join '..', 'lib', 'matchi'
|
3
|
-
|
4
|
-
# It is expected to be true
|
5
|
-
fail unless Matchi.fetch(:Match, /^foo/).matches? { 'foobar' }
|
6
|
-
|
7
|
-
# It is expected to be false
|
8
|
-
fail if Matchi.fetch(:Match, /^foo/).matches? { 'bar' }
|
@@ -1,15 +0,0 @@
|
|
1
|
-
require_relative File.join 'support', 'coverage'
|
2
|
-
require_relative File.join '..', 'lib', 'matchi'
|
3
|
-
|
4
|
-
# It is expected to be true
|
5
|
-
fail unless Matchi.fetch(:RaiseException, ZeroDivisionError).matches? { 0 / 0 }
|
6
|
-
|
7
|
-
# It is expected to be false
|
8
|
-
fail if Matchi.fetch(:RaiseException, ZeroDivisionError).matches? { 'bar' }
|
9
|
-
|
10
|
-
# It is expected to raise
|
11
|
-
begin
|
12
|
-
Matchi.fetch(:RaiseException, ZeroDivisionError).matches? { BOOM }
|
13
|
-
rescue NameError
|
14
|
-
true
|
15
|
-
end
|