specify 0.10.0 → 0.10.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: 2176feee363e08774e5723e4eb96372ca4b7810b
4
- data.tar.gz: b8461df286c06c232b85621f8a3b7f65d83efdc7
3
+ metadata.gz: 87785f51fa0d7d5c529b7856afdeec58b5fb33f2
4
+ data.tar.gz: 76ec7120adbd2fb1f2e0976756f9f9a7990bb825
5
5
  SHA512:
6
- metadata.gz: d78f06c2164d721397075a8f903c857ae83afdbe73d36891406ea1704abdb93053a8105ada7c9d3e8f0a287fea8e3e33bfbe7720cc4e04cbec5a2bcdd023a6a0
7
- data.tar.gz: f0c3a121504a3708fabc43ba124598bea8a7995c8328c3b4ece93acf4b87d8425dd1c4fd01adebf1b423e53476ea1c049fff180f5718d28d57e14ffd2896154b
6
+ metadata.gz: 8d0045e2c22929aff89fb8e34a707a4bc5dc2c62e5a9cee5f5eed38d04e50f382f86e22e3e90c8ec0241047f81e053d215d9a344668bba0535fe0d99bdf04ce9
7
+ data.tar.gz: 0904c0da9c04efc6cf88d3b056a1f58fdf8859f20cf1c41ed3b2d6f1151c5f005c27598076bc543e838c4222b19d0906024babf552f0a916f2a254f67ac808f5
data/.gitignore CHANGED
@@ -1,16 +1,29 @@
1
- /.idea/
2
- /.bundle/
3
- /.yardoc
4
- /Gemfile.lock
5
- /_yardoc/
6
- /coverage/
7
- /doc/
8
- /pkg/
9
- /spec/reports/
10
- /tmp/
1
+ *.gem
2
+ *.rbc
3
+ .idea
4
+ .bundle
5
+ .config
6
+ .yardoc
7
+ Gemfile.lock
8
+ InstalledFiles
9
+ _yardoc
10
+ coverage
11
+ doc/
12
+ lib/bundler/man
13
+ pkg
14
+ rdoc
15
+ spec/reports
16
+ spec/examples.txt
17
+ test/tmp
18
+ test/version_tmp
19
+ tmp
11
20
  *.bundle
12
21
  *.so
13
22
  *.o
14
23
  *.a
24
+ ._*
15
25
  mkmf.log
16
26
  .DS_Store
27
+ .DS_Store?
28
+ .Trashes
29
+ .thumbs.db
data/.hound.yml ADDED
@@ -0,0 +1,95 @@
1
+ AllCops:
2
+ Exclude:
3
+ - specify.gemspec
4
+ - test/*.rb
5
+ - spec/**/*
6
+
7
+ # missing top-level module documentation comment
8
+ Style/Documentation:
9
+ Enabled: false
10
+
11
+ # prefer reduce over inject
12
+ Style/CollectionMethods:
13
+ PreferredMethods:
14
+ reduce: 'inject'
15
+
16
+ # use each_with_object instead of inject
17
+ Style/EachWithObject:
18
+ Enabled: false
19
+
20
+ # removing the preference for string single quotes
21
+ Style/StringLiterals:
22
+ Enabled: false
23
+
24
+ # prefer fail over raise
25
+ Style/SignalException:
26
+ Enabled: false
27
+
28
+ Style/TrailingComma:
29
+ EnforcedStyleForMultiline: comma
30
+
31
+ # this never works for validations
32
+ Style/AlignHash:
33
+ EnforcedLastArgumentHashStyle: ignore_implicit
34
+
35
+ # align multi-line params with previous line
36
+ Style/AlignParameters:
37
+ EnforcedStyle: with_fixed_indentation
38
+
39
+ # indent `when` clause one step from `case`
40
+ Style/CaseIndentation:
41
+ IndentOneStep: true
42
+
43
+ # don't force crappy var names for reduce/inject loops
44
+ Style/SingleLineBlockParams:
45
+ Enabled: false
46
+
47
+ # for method chains, keep the dot with the method name
48
+ Style/DotPosition:
49
+ EnforcedStyle: leading
50
+
51
+ Style/AccessorMethodName:
52
+ Enabled: false
53
+
54
+ Style/PredicateName:
55
+ Enabled: false
56
+
57
+ Style/MethodName:
58
+ Enabled: false
59
+
60
+ Style/Alias:
61
+ Enabled: false
62
+
63
+ Style/Next:
64
+ Enabled: false
65
+
66
+ # stop nesting so hard
67
+ Metrics/BlockNesting:
68
+ Max: 2
69
+
70
+ # short methods
71
+ Metrics/MethodLength:
72
+ Max: 25
73
+
74
+ Metrics/LineLength:
75
+ Enabled: false
76
+ #Max: 115
77
+
78
+ # fewer parameters
79
+ Metrics/ParameterLists:
80
+ Max: 5
81
+
82
+ Metrics/AbcSize:
83
+ Enabled: false
84
+
85
+ Metrics/ModuleLength:
86
+ Max: 130
87
+
88
+ Metrics/CyclomaticComplexity:
89
+ Max: 12
90
+
91
+ Metrics/PerceivedComplexity:
92
+ Max: 12
93
+
94
+ Lint/RescueException:
95
+ Enabled: false
data/.rubocop.yml ADDED
@@ -0,0 +1,2 @@
1
+ inherit_from:
2
+ - .hound.yml
data/.travis.yml ADDED
@@ -0,0 +1,18 @@
1
+ language: ruby
2
+
3
+ sudo: false
4
+
5
+ rvm:
6
+ - 2.0.0
7
+ - 2.1
8
+ - 2.2
9
+
10
+ branches:
11
+ only:
12
+ - master
13
+
14
+ notifications:
15
+ recipients:
16
+ - jeffnyman@gmail.com
17
+
18
+ before_install: gem install bundler -v 1.10.6
@@ -0,0 +1,13 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4
+
5
+ We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
6
+
7
+ Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
8
+
9
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
10
+
11
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
12
+
13
+ This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
data/Gemfile CHANGED
@@ -1,7 +1,3 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gem 'simplecov', '~> 0.9.0', require: false
4
- gem 'coveralls', require: false
5
-
6
- # Specify your gem's dependencies in specify.gemspec
7
3
  gemspec
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2014 Jeff Nyman
1
+ Copyright (c) 2014-2016 Jeff Nyman
2
2
 
3
3
  MIT License
4
4
 
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Specify
2
2
 
3
- [![Codeship Status for jnyman/specify](https://www.codeship.io/projects/6fd98900-39d1-0132-7358-4e57ec3927cd/status)](https://www.codeship.io/projects/42264)
3
+ [![Build Status](https://travis-ci.org/jnyman/specify.svg)](https://travis-ci.org/jnyman/specify)
4
4
 
5
5
  [![Coverage Status](https://img.shields.io/coveralls/jnyman/specify.svg)](https://coveralls.io/r/jnyman/specify?branch=master)
6
6
  [![Gem Version](https://badge.fury.io/rb/specify.svg)](http://badge.fury.io/rb/specify)
@@ -19,17 +19,23 @@ Specify provides a very thin wrapper around RSpec that provides a Gherkin-style
19
19
 
20
20
  ## Installation
21
21
 
22
- Add this line to your application's Gemfile:
22
+ To get the latest stable release, add this line to your application's Gemfile:
23
23
 
24
24
  ```ruby
25
25
  gem 'specify'
26
26
  ```
27
27
 
28
- And then execute:
28
+ To get the latest code:
29
+
30
+ ```ruby
31
+ gem 'specify', git: https://github.com/jnyman/specify
32
+ ```
33
+
34
+ After doing one of the above, execute the following command:
29
35
 
30
36
  $ bundle
31
37
 
32
- Or install it yourself as:
38
+ You can also install Specify just as you would any other gem:
33
39
 
34
40
  $ gem install specify
35
41
 
@@ -72,6 +78,7 @@ To work on Specify:
72
78
  ## License
73
79
 
74
80
  Specify is distributed under the [MIT](http://www.opensource.org/licenses/MIT) license.
81
+ See the [LICENSE](https://github.com/jnyman/symbiont/blob/master/LICENSE.txt) file for details.
75
82
 
76
83
  ## Credits
77
84
 
@@ -81,5 +88,3 @@ Specify has been inspired by the following projects:
81
88
  * [rspec-gherkin](https://github.com/sheerun/rspec-gherkin)
82
89
  * [rspec example steps](https://github.com/railsware/rspec-example_steps)
83
90
  * [XSpec](https://github.com/xaviershay/xspec)
84
-
85
- The parameterized and table logic is pulled directly from [RSpec::Parameterized](https://github.com/tomykaira/rspec-parameterized) with just a few cosmetic changes.
data/Rakefile CHANGED
@@ -1,14 +1,18 @@
1
1
  #!/usr/bin/env rake
2
2
  require 'bundler/gem_tasks'
3
+ require 'rdoc/task'
4
+ require 'rubocop/rake_task'
3
5
  require 'rspec/core/rake_task'
4
6
 
7
+ RuboCop::RakeTask.new
8
+
5
9
  namespace :spec do
6
10
  desc 'Clean all generated reports'
7
11
  task :clean do
8
12
  system('rm -rf spec/reports')
9
13
  end
10
14
 
11
- RSpec::Core::RakeTask.new(:all => :clean) do |config|
15
+ RSpec::Core::RakeTask.new(all: :clean) do |config|
12
16
  options = %w(--color)
13
17
  options += %w(--format documentation)
14
18
  options += %w(--format html --out spec/reports/unit-test-report.html)
@@ -17,4 +21,11 @@ namespace :spec do
17
21
  end
18
22
  end
19
23
 
20
- task default: %w(spec:all)
24
+ Rake::RDocTask.new do |rdoc|
25
+ rdoc.rdoc_dir = 'doc'
26
+ rdoc.main = 'README.md'
27
+ rdoc.title = "Specify #{Specify::VERSION}"
28
+ rdoc.rdoc_files.include('README*', 'lib/**/*.rb')
29
+ end
30
+
31
+ task default: ['spec:all', :rubocop]
data/bin/console ADDED
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'bundler/setup'
4
+ require 'specify'
5
+
6
+ require 'pry'
7
+ Pry.start
8
+
9
+ # require 'irb'
10
+ # IRB.start
data/bin/setup ADDED
@@ -0,0 +1,5 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
@@ -57,10 +57,9 @@ module RSpec
57
57
  def example_started_with_steps(notification)
58
58
  example_started_without_steps(notification)
59
59
 
60
- if notification.example.metadata[:with_steps]
61
- full_message = "#{current_indentation}#{notification.example.description}"
62
- output.puts Core::Formatters::ConsoleCodes.wrap(full_message, :default)
63
- end
60
+ return unless notification.example.metadata[:with_steps]
61
+ full_message = "#{current_indentation}#{notification.example.description}"
62
+ output.puts Core::Formatters::ConsoleCodes.wrap(full_message, :default)
64
63
  end
65
64
 
66
65
  def example_passed_with_steps(notification)
@@ -1,7 +1,6 @@
1
1
  module RSpec
2
2
  module Specify
3
3
  module ExampleGroup
4
-
5
4
  # In Rspec, example group bodies are delimited by 'describe' and
6
5
  # 'context' methods. These encapsulate examples, which are
7
6
  # delimited by 'it' methods. Example groups are evaluated in the
@@ -12,19 +11,19 @@ module RSpec
12
11
  def include_steps(*args)
13
12
  name = args.shift
14
13
  shared_block = ::RSpec.world.shared_example_steps[name]
15
- shared_block or raise ArgumentError, "Could not find shared steps #{name.inspect}"
14
+ shared_block || raise(ArgumentError, "Could not find shared steps #{name.inspect}")
16
15
  instance_exec(*args, &shared_block)
17
16
  end
18
17
 
19
- def Given(message, options={}, &block)
18
+ def Given(message, options = {}, &block)
20
19
  Action :given, message, options, &block
21
20
  end
22
21
 
23
- def When(message, options={}, &block)
22
+ def When(message, options = {}, &block)
24
23
  Action :when, message, options, &block
25
24
  end
26
25
 
27
- def Then(message, options={}, &block)
26
+ def Then(message, options = {}, &block)
28
27
  Action :then, message, options, &block
29
28
  end
30
29
 
@@ -66,9 +65,9 @@ module RSpec
66
65
 
67
66
  private
68
67
 
69
- def Action(type, message, options = {}, &block)
68
+ def Action(type, message, options = {}, &_block)
70
69
  ::RSpec.world.reporter.example_step_started(self, type, message, options)
71
- options = {:pending => true} if options == :pending
70
+ options = { pending: true } if options == :pending
72
71
 
73
72
  if block_given? && !options[:pending]
74
73
  begin
@@ -81,7 +80,6 @@ module RSpec
81
80
  else
82
81
  ::RSpec.world.reporter.example_step_pending(self, type, message, options)
83
82
  end
84
-
85
83
  end
86
84
  end
87
85
  end
@@ -1,9 +1,8 @@
1
1
  module RSpec
2
2
  module Specify
3
-
4
3
  # In RSpec, notifications are value objects that are passed to formatters
5
4
  # to provide those formatters with information about a particular event.
6
- class Notification < Struct.new(:example, :type, :message, :options)
7
- end
5
+
6
+ Notification = Struct.new(:example, :type, :message, :options)
8
7
  end
9
8
  end
@@ -1,7 +1,6 @@
1
1
  module RSpec
2
2
  module Specify
3
3
  module Reporter
4
-
5
4
  # An RSpec reporter sends notifications to listeners. The listeners
6
5
  # are usually formatters for a specific test run.
7
6
 
@@ -9,9 +9,11 @@ module RSpec
9
9
  private
10
10
 
11
11
  def ensure_shared_example_steps_name_not_taken(name)
12
- if ::RSpec.world.shared_example_steps.has_key?(name)
13
- raise ArgumentError.new("Shared step '#{name}' already exists")
14
- end
12
+ return unless ::RSpec.world.shared_example_steps.key?(name)
13
+ raise(ArgumentError, "Shared step '#{name}' already exists")
14
+ # if ::RSpec.world.shared_example_steps.key?(name)
15
+ # raise ArgumentError.new("Shared step '#{name}' already exists")
16
+ # end
15
17
  end
16
18
  end
17
19
  end
@@ -1,7 +1,6 @@
1
1
  module RSpec
2
2
  module Specify
3
3
  module World
4
-
5
4
  # RSpec's world is an internal container for global
6
5
  # non-configuration data.
7
6
 
@@ -1,3 +1,3 @@
1
1
  module Specify
2
- VERSION = '0.10.0'
2
+ VERSION = '0.10.2'
3
3
  end
data/lib/specify.rb CHANGED
@@ -12,24 +12,22 @@ require 'specify/rspec/world'
12
12
  require 'specify/rspec/reporter'
13
13
  require 'specify/rspec/notification'
14
14
  require 'specify/rspec/example_group'
15
- require 'specify/rspec/parameterized'
16
15
  require 'specify/rspec/documentation_formatter'
17
16
 
18
17
  RSpec::Core::ExampleGroup.send :include, RSpec::Specify::ExampleGroup
19
- RSpec::Core::Reporter.send :include, RSpec::Specify::Reporter
20
- RSpec::Core::World.send :include, RSpec::Specify::World
18
+ RSpec::Core::Reporter.send :include, RSpec::Specify::Reporter
19
+ RSpec::Core::World.send :include, RSpec::Specify::World
21
20
 
22
21
  RSpec::Core::Formatters::DocumentationFormatter.send :include, RSpec::Specify::DocumentationFormatter
23
22
 
24
- if formatter = RSpec.world.reporter.find_registered_formatter(RSpec::Core::Formatters::DocumentationFormatter)
25
- RSpec.world.reporter.register_listener(
26
- formatter,
27
- :example_started,
28
- :example_step_passed,
29
- :example_step_pending,
30
- :example_step_failed
31
- )
32
- end
23
+ formatter = RSpec.world.reporter.find_registered_formatter(RSpec::Core::Formatters::DocumentationFormatter)
24
+ RSpec.world.reporter.register_listener(
25
+ formatter,
26
+ :example_started,
27
+ :example_step_passed,
28
+ :example_step_pending,
29
+ :example_step_failed,
30
+ ) if formatter
33
31
 
34
32
  RSpec::Core::ExampleGroup.define_example_method :Scenario, with_steps: true
35
33
  RSpec::Core::ExampleGroup.define_example_method :Condition, with_steps: true
data/specify.gemspec CHANGED
@@ -18,23 +18,20 @@ Gem::Specification.new do |spec|
18
18
  spec.homepage = 'https://github.com/jnyman/specify'
19
19
  spec.license = 'MIT'
20
20
 
21
- spec.files = `git ls-files -z`.split("\x0")
22
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
23
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
21
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
22
+ spec.bindir = 'exe'
23
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
24
24
  spec.require_paths = ['lib']
25
25
 
26
- spec.required_ruby_version = '>= 2.0.0'
26
+ spec.required_ruby_version = '>= 2.0'
27
27
  spec.required_rubygems_version = '>= 1.8.29'
28
28
 
29
- spec.add_development_dependency 'bundler', '~> 1.7'
29
+ spec.add_development_dependency 'bundler', '~> 1.10'
30
30
  spec.add_development_dependency 'rake', '~> 10.0'
31
- spec.add_development_dependency 'rspec', '~> 3.1'
32
-
33
- spec.add_runtime_dependency 'rspec-core', '~> 3.1'
34
- spec.add_runtime_dependency 'parser'
35
- spec.add_runtime_dependency 'unparser'
36
- spec.add_runtime_dependency 'proc_to_ast'
37
- spec.add_runtime_dependency 'binding_of_caller'
31
+ spec.add_development_dependency 'rspec'
32
+ spec.add_development_dependency 'pry'
33
+ spec.add_development_dependency 'simplecov'
34
+ spec.add_development_dependency 'rubocop'
38
35
 
39
36
  spec.post_install_message = %{
40
37
  (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::)