rspec_typeof 0.3.1 → 0.3.3

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: 304b54494c43ca8eed064e6965b27b8abd4a0004
4
- data.tar.gz: 1c40686275cf7225e71102c666e82752dcd90b70
3
+ metadata.gz: e92f0934e150361b30051d9e34e8d780e8f987fb
4
+ data.tar.gz: 98677e3ea77e66f4ba10ef45826b65e3bd51850b
5
5
  SHA512:
6
- metadata.gz: f2b08e264523b075f80a6bc323289da1d71819be2a075bf8c414773daabe0fbb3d27059a94ea7e1cd53e2ecf25f69415b3980224c8f96919449e806a75f2d5b4
7
- data.tar.gz: 5d4577278d3febadeb79422fba9b06e5e3908d12d0971be0ce6265ce7caeacf68166063ab6412e8e703799e285cb97f7ee25634ba11e5006fd6df616cee77ec6
6
+ metadata.gz: f193db7ecf771bc39294245aa4ccb2f8580aa7817cd0af6ba656650eda90bdc4aac5cbe4e6bb4693901ce6a2e5af2f563652c6e45639d7079540c1df917fd6dd
7
+ data.tar.gz: 4c79877b5749d634e0d6b0927490451b91108bafef007671826c1e0d9ac464da154368b290df44956fab1c53ea4dee674f4ce2d61f248c32a3bd8f3c3ed3cb53
data/.travis.yml CHANGED
@@ -1,4 +1,7 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.1.2
3
+ - 2.2
4
+ - 2.1
5
+ - 2.0.0
6
+ - 1.9.3
4
7
  before_install: gem install bundler
data/Gemfile CHANGED
@@ -1,4 +1,5 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in rspec_typeof.gemspec
4
+ gem 'pry'
4
5
  gemspec
data/LICENSE.txt CHANGED
@@ -1,5 +1,5 @@
1
1
  The MIT License (MIT)
2
- Copyright (c) 2016 Somiel
2
+ Copyright (c) 2016 Max Vovchuk
3
3
 
4
4
  Permission is hereby granted, free of charge, to any person obtaining a copy of
5
5
  this software and associated documentation files (the "Software"), to deal in
data/README.md CHANGED
@@ -1,7 +1,9 @@
1
1
  # RspecTypeof
2
+ [![Gem Version](https://badge.fury.io/rb/rspec_typeof.svg)](https://badge.fury.io/rb/rspec_typeof)
3
+ [![CodeClimate](https://codeclimate.com/github/Somiel/rspec_typeof/badges/gpa.svg)](https://codeclimate.com/github/Somiel/rspec_typeof)
2
4
  [![Build Status](https://travis-ci.org/Somiel/rspec_typeof.svg?branch=master)](https://travis-ci.org/Somiel/rspec_typeof)
3
5
 
4
- Welcome to rspec_typeof, with this gem you can use "typeof" expectation to your tests for comfortable data format matching
6
+ Welcome to rspec_typeof, with this gem you can use "typeof" expectation in your tests for comfortable data format matching of both single data examples and data collections
5
7
 
6
8
 
7
9
  ## Installation
@@ -20,13 +22,15 @@ And then execute:
20
22
 
21
23
 
22
24
  ```ruby
25
+ expect(true).to typeof(:true)
26
+
23
27
  expect(true).to typeof(:string_or_nil_or_true)
24
28
 
25
- expect({ string: 'string', fixnum: 2, hash: {}, array: [], custom_class: CustomClass}).to match(
29
+ expect({string: 'string', fixnum: 2, hash: {}, array: [], custom_class: CustomClass.new}).to match(
26
30
  string: typeof(:string_or_nil),
27
31
  fixnum: typeof(:fixnum_or_nil),
28
32
  hash: typeof(:hash_or_nil_or_string),
29
- array: typeof(:array_class_or_nil),
33
+ array: typeof(:array_or_nil),
30
34
  custom_class: typeof(:custom_class_or_nil_or_array)
31
35
  )
32
36
 
@@ -20,6 +20,8 @@ RSpec::Matchers.define :typeof do |expected_types|
20
20
  match do |actual|
21
21
  expect(actual).to satisfy do |x|
22
22
  if expected_types.to_s.scan(/^array_of_\w+/).length > 0
23
+ return false unless x.is_a? Array
24
+
23
25
  x.all? { |el| types.include?(el.class.name) }
24
26
  else
25
27
  types.include?(x.class.name)
@@ -1,3 +1,3 @@
1
1
  module RspecTypeof
2
- VERSION = '0.3.1'
2
+ VERSION = '0.3.3'
3
3
  end
data/rspec_typeof.gemspec CHANGED
@@ -9,8 +9,8 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ["Vovchuk Max"]
10
10
  spec.email = ["vovchuk.max@gmail.com"]
11
11
 
12
- spec.summary = %q{Add typeof matcher to Rspec}
13
- spec.description = %q{Add typeof matcher to Rspec}
12
+ spec.summary = %q{Add typeof data type matcher to RSpec}
13
+ spec.description = %q{This gem provides comfortable using of data types mathching in your RSpec tests}
14
14
  spec.homepage = "https://github.com/Somiel/rspec_typeof"
15
15
 
16
16
  spec.licenses = ['MIT']
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec_typeof
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vovchuk Max
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-11-11 00:00:00.000000000 Z
11
+ date: 2016-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -52,7 +52,8 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '11.2'
55
- description: Add typeof matcher to Rspec
55
+ description: This gem provides comfortable using of data types mathching in your RSpec
56
+ tests
56
57
  email:
57
58
  - vovchuk.max@gmail.com
58
59
  executables: []
@@ -96,5 +97,5 @@ rubyforge_project:
96
97
  rubygems_version: 2.5.1
97
98
  signing_key:
98
99
  specification_version: 4
99
- summary: Add typeof matcher to Rspec
100
+ summary: Add typeof data type matcher to RSpec
100
101
  test_files: []