interface_comparator 0.1.0 → 0.1.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e579725cba7c91ca4c3965e2625a47ab3fc50f1f
4
- data.tar.gz: d2e0c72acda4efc1c965a65c5212d3f7e77c2404
3
+ metadata.gz: ab52ecbe5d7bbe7c2135073b650a96e7a68df233
4
+ data.tar.gz: 0ee0f8b979afa011e8ef340c8834befa603ea244
5
5
  SHA512:
6
- metadata.gz: 5d77a0b885fac31bf2e27a9a4be1b97878de3b5d61aee9a542d6be1b5e1a19f735ff36f8f909140b636ac879a4ad5511edeefc97f1448eaf940e9541afac052a
7
- data.tar.gz: 685ecec0a47fa343a8605de4c38d16e6abd0b5cd1948def8d1973537e23b17c063637115f3a87c71f62e8c975d0b4e4348ac3fbc9e9128127acc054160183962
6
+ metadata.gz: 1a72e81effab2c519c736284cdb6bf22f7c6ffa1918f1053b2a5922c6b360fd8472ae3ab6a1ff9b6937a300e29b9f75d75f5c68607bcd6762c3fc1d04ca77ae6
7
+ data.tar.gz: ca6ebad2c0e5cd90e8c2d6e2adb3ffd98b862e65b6ccc868b44c58fe753c389ea4d3dd0c09ac6fb3740d0b79f2375212854a552317fb655537b5018e41a92c96
data/README.md CHANGED
@@ -45,6 +45,20 @@ InterfaceComparator.diff_interfaces(a, b)
45
45
  #}]
46
46
  ```
47
47
 
48
+ ## Usage with minitest
49
+
50
+ If you want to use it with minitest, please require helper:
51
+ ```ruby
52
+ require 'interface_comparator/minitest'
53
+ ```
54
+
55
+ Library will provide you with two new assertions:
56
+ ```ruby
57
+ assert_equal_interfaces a, b
58
+ refute_equal_interfaces a, b
59
+ ```
60
+
61
+ Output in case of failure will be similar to those in diff_interfaces.
48
62
 
49
63
  ## Development
50
64
 
@@ -0,0 +1,17 @@
1
+ module Minitest::Assertions
2
+ #
3
+ # Fails unless +object_a and +object_a have the same interfaces (in terms of method and their arity).
4
+ #
5
+ def assert_equal_interfaces(object_a, object_b)
6
+ assert InterfaceComparator.interfaces_are_same?(object_a, object_b),
7
+ "Interfaces are not the same: #{InterfaceComparator.diff_interfaces(object_a, object_b)}"
8
+ end
9
+
10
+ #
11
+ # Fails if +object_a and +object_a have the same interfaces (in terms of method and their arity).
12
+ #
13
+ def refute_equal_interfaces(object_a, object_b)
14
+ refute InterfaceComparator.interfaces_are_same?(object_a, object_b),
15
+ "Interfaces are of these two object are the same"
16
+ end
17
+ end
@@ -1,3 +1,3 @@
1
1
  module InterfaceComparator
2
- VERSION = '0.1.0'.freeze
2
+ VERSION = '0.1.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: interface_comparator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Szmielew
@@ -84,6 +84,7 @@ files:
84
84
  - bin/setup
85
85
  - interface_comparator.gemspec
86
86
  - lib/interface_comparator.rb
87
+ - lib/interface_comparator/minitest.rb
87
88
  - lib/interface_comparator/version.rb
88
89
  homepage: https://github.com/esse/interface_comparator
89
90
  licenses:
@@ -105,7 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
105
106
  version: '0'
106
107
  requirements: []
107
108
  rubyforge_project:
108
- rubygems_version: 2.5.1
109
+ rubygems_version: 2.6.11
109
110
  signing_key:
110
111
  specification_version: 4
111
112
  summary: Module that checks if two objects has the same interface including public