rspec-paramz 1.0.0 → 1.1.0

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
  SHA256:
3
- metadata.gz: 974cf77b3ed42146c25af78805d1e2e87fc8b666ef743830b0d5de4d792f35fb
4
- data.tar.gz: cc1ffbcb73711c259e537c7466c55a66561f92cc66201bf4d7134e609f8817b0
3
+ metadata.gz: 610d87ecec6b05b0743ff2c73eed111eb0fd01ef7f40cf4d74b655d06c4f9b40
4
+ data.tar.gz: c2aaedba4a6c9c6555ac250c14a0fdf35f9f00e8e83c2a776dc693547708ea0d
5
5
  SHA512:
6
- metadata.gz: 9a66d490cd774db29223ca2dd1121e2e76522807333b6847e55f7fa3f7629aa54926cb484dddada7bd8dd629c97b8e1638247c9e212ba368e8bf4e35719f3e47
7
- data.tar.gz: 27471467415c6cd6d21aa1418721e31089c7a9ccf15ae514f71873ccf947798e3e9dcd6b26816fed9d5635cb34f0b3a2d4c6646f98f2bba1b23a1889d76de3ea
6
+ metadata.gz: 5f67a5721893964af719f8df816191b67fd92967c556af6d1e8c1e5f1cc62e53db90b3d7a1345b05f99623b68a176c9aa53adb24289f0c567c55145a033207fe
7
+ data.tar.gz: 1c040193b5b980f062ee9c8fa029badccbc12460bf16092c7a78acdd2f25825915d96248be45c144f5e087d7cd559d0b0b1ecdf4577346f88ea25f9eecc37131
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rspec-paramz (0.1.0)
4
+ rspec-paramz (1.0.0)
5
5
  rspec (~> 3.0)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -1,9 +1,14 @@
1
- # RSpec::Paramz [![Build Status](https://travis-ci.org/fukayatsu/rspec-paramz.svg?branch=master)](https://travis-ci.org/fukayatsu/rspec-paramz)
1
+ # RSpec::Paramz [![Gem Version](https://badge.fury.io/rb/rspec-paramz.svg)](https://badge.fury.io/rb/rspec-paramz) [![Build Status](https://travis-ci.org/fukayatsu/rspec-paramz.svg?branch=master)](https://travis-ci.org/fukayatsu/rspec-paramz)
2
2
 
3
3
  Simple Parameterized Test for RSpec.
4
4
 
5
5
  Inspired by [tomykaira/rspec-parameterized](https://github.com/tomykaira/rspec-parameterized).
6
6
 
7
+ ## Requirements
8
+
9
+ - Ruby 2.6 or later
10
+ - This gem uses `RubyVM::AbstractSyntaxTree`
11
+
7
12
  ## Installation
8
13
 
9
14
  Add this line to your application's Gemfile:
@@ -131,6 +136,25 @@ RSpec.describe RSpec::Paramz do
131
136
  # should do additions
132
137
  end
133
138
 
139
+ context 'format 4' do
140
+ subject { a + b }
141
+
142
+ paramz(
143
+ [:a, :b, :subject],
144
+ 1, 2, 3,
145
+ 0, 0, 0,
146
+ -1, -2, -3,
147
+ )
148
+
149
+ #=>
150
+ # [a = 1 | b = 2 | subject = 3]
151
+ # should == 3
152
+ # [a = 0 | b = 0 | subject = 0]
153
+ # should == 0
154
+ # [a = -1 | b = -2 | subject = -3]
155
+ # should == -3
156
+ end
157
+
134
158
  context 'rspec-let' do
135
159
  let(:one) { 1 }
136
160
  let(:two) { one * 2 }
@@ -21,6 +21,11 @@ module RSpec
21
21
  context context_name do
22
22
  pairs.each do |label, val|
23
23
  if subject_label?(label)
24
+ if label == :subject
25
+ it { should == val }
26
+ next
27
+ end
28
+
24
29
  _subject, _subject_name = parse_subject(label)
25
30
 
26
31
  module_exec { _subject.is_a?(Proc) ? subject(_subject_name, &_subject) : subject(_subject_name) { _subject } }
@@ -45,6 +50,7 @@ module RSpec
45
50
  private
46
51
 
47
52
  def subject_label?(label)
53
+ return true if label == :subject
48
54
  label.is_a?(Hash) && label.keys == [:subject]
49
55
  end
50
56
 
@@ -1,5 +1,5 @@
1
1
  module RSpec
2
2
  module Paramz
3
- VERSION = "1.0.0"
3
+ VERSION = "1.1.0"
4
4
  end
5
5
  end
@@ -15,7 +15,7 @@ Gem::Specification.new do |spec|
15
15
 
16
16
  spec.metadata["homepage_uri"] = spec.homepage
17
17
  spec.metadata["source_code_uri"] = "https://github.com/fukayatsu/rspec-paramz"
18
- # spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here."
18
+ spec.metadata["changelog_uri"] = "https://github.com/fukayatsu/rspec-paramz/releases"
19
19
 
20
20
  # Specify which files should be added to the gem when it is released.
21
21
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-paramz
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - fukayatsu
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-07-07 00:00:00.000000000 Z
11
+ date: 2019-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -112,6 +112,7 @@ licenses:
112
112
  metadata:
113
113
  homepage_uri: https://github.com/fukayatsu/rspec-paramz
114
114
  source_code_uri: https://github.com/fukayatsu/rspec-paramz
115
+ changelog_uri: https://github.com/fukayatsu/rspec-paramz/releases
115
116
  post_install_message:
116
117
  rdoc_options: []
117
118
  require_paths: