cucumber-blendle-steps 0.9.1 → 0.9.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +2 -0
- data/.rubocop_todo.yml +17 -0
- data/Gemfile +2 -0
- data/Rakefile +5 -3
- data/cucumber-blendle-steps.gemspec +4 -2
- data/lib/cucumber/blendle/helpers/liquid_filters.rb +2 -0
- data/lib/cucumber/blendle/steps/benchmark_steps.rb +2 -0
- data/lib/cucumber/blendle/steps/debug_steps.rb +2 -0
- data/lib/cucumber/blendle/steps/mock_server_steps.rb +4 -2
- data/lib/cucumber/blendle/steps/model_steps.rb +5 -3
- data/lib/cucumber/blendle/steps/resource_steps.rb +3 -1
- data/lib/cucumber/blendle/steps/rest_steps.rb +3 -1
- data/lib/cucumber/blendle/support/cucumber.rb +2 -0
- data/lib/cucumber/blendle/support/dump.rb +3 -1
- data/lib/cucumber/blendle/support/hyper_resource.rb +2 -0
- data/lib/cucumber/blendle/support/json_spec.rb +2 -0
- data/lib/cucumber/blendle/support/minitest.rb +2 -0
- data/lib/cucumber/blendle/support/rack_test.rb +2 -0
- data/lib/cucumber/blendle/version.rb +1 -1
- data/lib/cucumber/blendle_steps.rb +2 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f0fd0357601a6be407569b6ff009b9c97b2472fb
|
4
|
+
data.tar.gz: 4b3f3de408e3d41198925d258d12a3c70e373708
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a5ec3ff5e3a90ed52191321ff588d304593a4bc94baf748bf28a9e41959a7fd58a50aef01e135f79ef373d13bb972eccbf5530b6ef60f68308c4b1f8cedb842e
|
7
|
+
data.tar.gz: d53167b99054560b2f0a1773cee1dfad33ba78d96e0a65dd8b98bf57b34121c82a7684762eaece1ca56d32f1d76bb2b1787b2d9730cb6c112f19bb17c34200ea
|
data/.rubocop.yml
CHANGED
data/.rubocop_todo.yml
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# This configuration was generated by
|
2
|
+
# `rubocop --auto-gen-config`
|
3
|
+
# on 2017-06-21 13:09:32 +0200 using RuboCop version 0.49.1.
|
4
|
+
# The point is for the user to remove these configuration records
|
5
|
+
# one by one as the offenses are removed from the code base.
|
6
|
+
# Note that changes in the inspected code, or installation of new
|
7
|
+
# versions of RuboCop, may require this file to be generated again.
|
8
|
+
|
9
|
+
# Offense count: 1
|
10
|
+
# Configuration parameters: CountComments, ExcludedMethods.
|
11
|
+
Metrics/BlockLength:
|
12
|
+
Max: 31
|
13
|
+
|
14
|
+
# Offense count: 1
|
15
|
+
# Configuration parameters: CountKeywordArgs.
|
16
|
+
Metrics/ParameterLists:
|
17
|
+
Max: 7
|
data/Gemfile
CHANGED
data/Rakefile
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'bundler/gem_tasks'
|
2
4
|
require 'rubygems'
|
3
5
|
require 'cucumber'
|
@@ -6,7 +8,7 @@ require 'rubocop/rake_task'
|
|
6
8
|
require 'rake/testtask'
|
7
9
|
|
8
10
|
task 'changelog' do
|
9
|
-
args = %w
|
11
|
+
args = %w[
|
10
12
|
--user=blendle
|
11
13
|
--project=cucumber-blendle-steps
|
12
14
|
--header-label="# CHANGELOG"
|
@@ -14,7 +16,7 @@ task 'changelog' do
|
|
14
16
|
--enhancement-labels=type/enhancement,enhancement
|
15
17
|
--future-release=unreleased
|
16
18
|
--no-verbose
|
17
|
-
|
19
|
+
]
|
18
20
|
|
19
21
|
sh %(github_changelog_generator #{args.join(' ')})
|
20
22
|
end
|
@@ -31,4 +33,4 @@ Rake::TestTask.new(:test) do |test|
|
|
31
33
|
test.verbose = true
|
32
34
|
end
|
33
35
|
|
34
|
-
task default: [
|
36
|
+
task default: %i[rubocop test features]
|
@@ -1,4 +1,6 @@
|
|
1
1
|
# coding: utf-8
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
2
4
|
lib = File.expand_path('../lib', __FILE__)
|
3
5
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
6
|
require 'cucumber/blendle/version'
|
@@ -7,14 +9,14 @@ Gem::Specification.new do |spec|
|
|
7
9
|
spec.name = 'cucumber-blendle-steps'
|
8
10
|
spec.version = Cucumber::BlendleSteps::VERSION
|
9
11
|
spec.authors = ['Jean Mertz']
|
10
|
-
spec.email = %w
|
12
|
+
spec.email = %w[jean@blendle.com]
|
11
13
|
spec.summary = 'Cucumber steps used by all of Blendle Ruby projects'
|
12
14
|
spec.homepage = 'https://www.blendle.com'
|
13
15
|
|
14
16
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(features)/}) }
|
15
17
|
spec.bindir = 'bin'
|
16
18
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
17
|
-
spec.require_paths = %w
|
19
|
+
spec.require_paths = %w[lib]
|
18
20
|
|
19
21
|
spec.add_dependency 'activesupport'
|
20
22
|
spec.add_dependency 'chronic'
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'net/http'
|
2
4
|
require 'json'
|
3
5
|
|
@@ -19,11 +21,11 @@ Given(/^the following endpoint configurations:$/) do |table|
|
|
19
21
|
table.hashes.each do |row|
|
20
22
|
payload = { request: {}, response: {} }
|
21
23
|
|
22
|
-
%i
|
24
|
+
%i[method endpoint].each do |option|
|
23
25
|
payload[:request][option.to_sym] = row[option.to_s]
|
24
26
|
end
|
25
27
|
|
26
|
-
%i
|
28
|
+
%i[status headers body].each do |option|
|
27
29
|
payload[:response][option.to_sym] = row[option.to_s]
|
28
30
|
end
|
29
31
|
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'active_support/core_ext/hash/keys'
|
2
4
|
require 'active_support/core_ext/hash/compact'
|
3
5
|
require 'active_support/core_ext/object/blank'
|
@@ -136,14 +138,14 @@ def parse_row(row, object_name)
|
|
136
138
|
end
|
137
139
|
|
138
140
|
def row_finder(klass, hash)
|
139
|
-
ext = '
|
141
|
+
ext = ''
|
140
142
|
query = hash.each_with_object({}) do |(key, value), q|
|
141
143
|
if defined?(Sequel::Postgres::JSONBHash) && value.is_a?(Sequel::Postgres::JSONBHash)
|
142
|
-
ext = "where { Sequel.pg_jsonb(:#{key}).contains(#{value}) }"
|
144
|
+
ext = ".where { Sequel.pg_jsonb(:#{key}).contains(#{value}) }"
|
143
145
|
else
|
144
146
|
q[key] = value
|
145
147
|
end
|
146
148
|
end
|
147
149
|
|
148
|
-
eval "#{klass}
|
150
|
+
eval "#{klass}#{ext}.first(query)"
|
149
151
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# rubocop:disable Metrics/LineLength
|
2
4
|
|
3
5
|
# * When the client does a GET request to the "items" resource
|
@@ -9,7 +11,7 @@ end
|
|
9
11
|
# * When the client does a GET request to the "item" resource with the template variable "item_uid" set to "hello"
|
10
12
|
#
|
11
13
|
When(/^the client does a (GET|POST|DELETE) request to the "([^"]*)" resource with the template variable "([^"]*)" set to "([^"]*)"$/) do |method, resource, key, value|
|
12
|
-
tables = [%w
|
14
|
+
tables = [%w[key value], [key, value]]
|
13
15
|
|
14
16
|
step %(the client does a #{method} request to the "#{resource}" resource with these template variables:), table(tables)
|
15
17
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# rubocop:disable Metrics/LineLength
|
2
4
|
|
3
5
|
require 'halidator'
|
@@ -99,7 +101,7 @@ end
|
|
99
101
|
# { "end_date": "{{ 'today' | date }}" } => { "date": "2016-03-15T14:00:00Z" }
|
100
102
|
#
|
101
103
|
Then(%r{^the response should be HAL/JSON(?: \(disregarding values? of "([^"]*)"\))?:$}) do |disregard, json|
|
102
|
-
step(
|
104
|
+
step('the response should be HAL/JSON')
|
103
105
|
|
104
106
|
json = Liquid::Template.parse(json).render
|
105
107
|
match = be_json_eql(json)
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'json'
|
2
4
|
|
3
5
|
After do |scenario|
|
@@ -18,7 +20,7 @@ def dump(data)
|
|
18
20
|
|
19
21
|
require 'mkmf'
|
20
22
|
|
21
|
-
if %w
|
23
|
+
if %w[file tmp].include?(ENV['DUMP'])
|
22
24
|
File.open('/tmp/dump', 'w') { |f| f << pretty_sorted_json(data) }
|
23
25
|
elsif ENV['DUMP'] && find_executable0('pbcopy')
|
24
26
|
IO.popen(['pbcopy'], 'w') { |f| f << pretty_sorted_json(data) }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cucumber-blendle-steps
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jean Mertz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-09-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -314,6 +314,7 @@ files:
|
|
314
314
|
- ".gitignore"
|
315
315
|
- ".hubbit.yml"
|
316
316
|
- ".rubocop.yml"
|
317
|
+
- ".rubocop_todo.yml"
|
317
318
|
- ".ruby-version"
|
318
319
|
- ".wercker.yml"
|
319
320
|
- CHANGELOG.md
|
@@ -355,7 +356,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
355
356
|
version: '0'
|
356
357
|
requirements: []
|
357
358
|
rubyforge_project:
|
358
|
-
rubygems_version: 2.6.
|
359
|
+
rubygems_version: 2.6.13
|
359
360
|
signing_key:
|
360
361
|
specification_version: 4
|
361
362
|
summary: Cucumber steps used by all of Blendle Ruby projects
|