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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 68a2386409853587c7440b1afff70b67996bc928
4
- data.tar.gz: 5df959dea61b252a834dda79e6efa4d6be740005
3
+ metadata.gz: f0fd0357601a6be407569b6ff009b9c97b2472fb
4
+ data.tar.gz: 4b3f3de408e3d41198925d258d12a3c70e373708
5
5
  SHA512:
6
- metadata.gz: a56fd8e5e522c290d1dade59fa26cc547dcc433a707109adfcb6985410e6517d72cc74c6095d5271cb0e6a0059ca145423783f540f45b67ea50f8eddbb426b5e
7
- data.tar.gz: a0a9bf41f41f9421aa14315c2646632c78da2d5dd4fea79785b2f33677c640fa5f42aff49c68f4cde5d206a8bf04f3e9675e98689819d4138c1c45e886702d0a
6
+ metadata.gz: a5ec3ff5e3a90ed52191321ff588d304593a4bc94baf748bf28a9e41959a7fd58a50aef01e135f79ef373d13bb972eccbf5530b6ef60f68308c4b1f8cedb842e
7
+ data.tar.gz: d53167b99054560b2f0a1773cee1dfad33ba78d96e0a65dd8b98bf57b34121c82a7684762eaece1ca56d32f1d76bb2b1787b2d9730cb6c112f19bb17c34200ea
data/.rubocop.yml CHANGED
@@ -1,2 +1,4 @@
1
+ inherit_from: .rubocop_todo.yml
2
+
1
3
  Metrics/LineLength:
2
4
  Max: 100
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
@@ -1,2 +1,4 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
  gemspec
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: [:rubocop, :test, :features]
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(jean@blendle.com)
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(lib)
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 'liquid'
2
4
  require 'chronic'
3
5
  require 'time'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'typhoeus'
2
4
 
3
5
  def last_requests # rubocop:disable Style/TrivialAccessors
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # * Then I want to pry
2
4
  # * Then I want to debug
3
5
  #
@@ -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(method endpoint).each do |option|
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(status headers body).each do |option|
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 = 'where'
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}.#{ext}.first(query)"
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(key value), [key, value]]
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("the response should be HAL/JSON")
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
  Before do |scenario|
2
4
  @scenario_name = scenario.name
3
5
  @scenario_hash = Digest::SHA1.hexdigest(@scenario_name)[0...5]
@@ -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(file tmp).include?(ENV['DUMP'])
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) }
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'hyperresource'
2
4
 
3
5
  def HyperResource.from_body(body)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'json_spec/cucumber'
2
4
 
3
5
  JsonSpec.configure do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'minitest'
2
4
 
3
5
  # :no-doc:
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rack/test'
2
4
 
3
5
  World(Rack::Test::Methods)
@@ -6,6 +6,6 @@ module Cucumber
6
6
  # This module defines default steps used by all of Blendle Ruby projects.
7
7
  #
8
8
  module BlendleSteps
9
- VERSION = '0.9.1'.freeze
9
+ VERSION = '0.9.2'
10
10
  end
11
11
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'cucumber/blendle/helpers/liquid_filters'
2
4
 
3
5
  require 'cucumber/blendle/support/cucumber'
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.1
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: 2016-12-31 00:00:00.000000000 Z
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.8
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