standard_assert 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 101e45d6e7417a8a39df65b88cb1baac4f0704ea17ead5fc9149a4ff3eba27e9
4
- data.tar.gz: 654e4c80088a7874aa81b61395c8b2352260462b13786aba023e281bce6b6032
3
+ metadata.gz: 3316ab8f33b749374cc006c40658940915e7098c827fd20ca7b2229429b205d4
4
+ data.tar.gz: 6944543a4b9271ed2e7156d5f5f0bdd2d6a09842571e33dd3cdb8092013c6799
5
5
  SHA512:
6
- metadata.gz: 2141b01aee576fca5f5437aa81ddb139577689d3db32d27dc758b10dfd7849ba0b28990476aac83e19c55fd4e7a83e1d94f8959a54bc210358589ee67599310d
7
- data.tar.gz: 7706a9916d732931c969ca40921482af94d4172bd2fd3bc0c9b7930810bdc963810413cff129a45e504c17e0cf8d3976d1494fd3c8f02faa5b1d493dbc568aa6
6
+ metadata.gz: 939984e99601d6dfb8ee2ef1a72cd0ac76e4a54c6f2437bdde9c0d8b7e8881b02942059de9fc3a705c434a6e13ad8c8855494d491afe2fd42df75788f18b795a
7
+ data.tar.gz: 045e55acb59fd7a97717b1776842cf8312d272b5a1c89f81424ae28d2069bacc4a8e3855677e86e2770f103fb71b693e1efd32ab182c4e5e5da56a7c380aea82
data/CHANGELOG.md ADDED
@@ -0,0 +1,12 @@
1
+ # CHANGELOG
2
+
3
+ ## [0.2.1](https://github.com/yasaichi/standard_assert/releases/tag/v0.2.1) (December 14, 2019)
4
+
5
+ ### Compatible changes
6
+
7
+ - [Migration testing framework](https://github.com/yasaichi/standard_assert/commit/7d7f692234a099a85a9d79a0cd9b15047963eefc)
8
+ - [Apply RuboCop autofix](https://github.com/yasaichi/standard_assert/commit/a7f0ddf984250fcec588a41b84c380b932af2a5f)
9
+
10
+ ## [0.2.0](https://github.com/yasaichi/standard_assert/releases/tag/v0.2.0) (December 14, 2019)
11
+
12
+ - The initial release
data/README.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # standard_assert
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/standard_assert.svg)](http://badge.fury.io/rb/standard_assert)
4
+ [![Build Status](https://travis-ci.org/yasaichi/standard_assert.svg?branch=master)](https://travis-ci.org/yasaichi/standard_assert)
5
+ [![Code Climate](https://codeclimate.com/github/yasaichi/standard_assert/badges/gpa.svg)](https://codeclimate.com/github/yasaichi/standard_assert)
6
+ [![Test Coverage](https://codeclimate.com/github/yasaichi/standard_assert/badges/coverage.svg)](https://codeclimate.com/github/yasaichi/standard_assert/coverage)
7
+
3
8
  `standard_assert` is a Standard Library-like library for assertions in Ruby.
4
9
  It is aimed at encouraging us to use assertion methods anywhere; Not only testing but also production.
5
10
 
@@ -27,17 +32,18 @@ require 'standard_assert'
27
32
  module MyMath
28
33
  extend ::Assert
29
34
 
30
- module_function def abs(x)
31
- assert_kind_of(::Numeric, x)
32
- x > 0 ? x : -x
35
+ module_function
36
+
37
+ def abs(num)
38
+ assert_instance_of([::Float, ::Integer, ::Rational], num)
39
+ num.positive? ? num : -num
33
40
  end
34
41
  end
35
42
 
36
43
  MyMath.abs('42')
37
- #=> AssertionError:
38
- # <"42"> was expected to be kind_of?
39
- # <Numeric> but was
40
- # <String>.
44
+ #=> AssertionError: <"42"> was expected to be instance_of?
45
+ # [<Float>, <Integer>, <Rational>] but was
46
+ # <String>.
41
47
  ```
42
48
 
43
49
  ## Contributing
data/Rakefile CHANGED
@@ -1,6 +1,12 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
4
+ require "rake/testtask"
3
5
 
4
- RSpec::Core::RakeTask.new(:spec)
6
+ Rake::TestTask.new(:test) do |t|
7
+ t.libs << "test"
8
+ t.libs << "lib"
9
+ t.test_files = FileList["test/**/*_test.rb"]
10
+ end
5
11
 
6
- task :default => :spec
12
+ task default: :test
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "test/unit/assertions"
2
4
 
3
5
  module Assert
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "forwardable"
2
4
  require "test/unit/assertion-failed-error"
3
5
 
@@ -1,3 +1,7 @@
1
+ # rubocop:disable Style/FrozenStringLiteralComment
2
+
1
3
  module StandardAssert
2
- VERSION = "0.2.0".freeze
4
+ VERSION = "0.2.1".freeze
3
5
  end
6
+
7
+ # rubocop:enable Style/FrozenStringLiteralComment
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative "standard_assert/core_ext/assert"
2
4
  require_relative "standard_assert/core_ext/assertion_error"
3
5
  require_relative "standard_assert/version"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: standard_assert
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - yasaichi
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: reek
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: rspec
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -66,6 +80,20 @@ dependencies:
66
80
  - - ">="
67
81
  - !ruby/object:Gem::Version
68
82
  version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: simplecov
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
69
97
  - !ruby/object:Gem::Dependency
70
98
  name: test-unit
71
99
  requirement: !ruby/object:Gem::Requirement
@@ -89,6 +117,7 @@ executables: []
89
117
  extensions: []
90
118
  extra_rdoc_files: []
91
119
  files:
120
+ - CHANGELOG.md
92
121
  - LICENSE.txt
93
122
  - README.md
94
123
  - Rakefile
@@ -115,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
115
144
  - !ruby/object:Gem::Version
116
145
  version: '0'
117
146
  requirements: []
118
- rubygems_version: 3.0.1
147
+ rubygems_version: 3.0.3
119
148
  signing_key:
120
149
  specification_version: 4
121
150
  summary: Standard Library-like library for assertions in Ruby