rspec-bdd 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 119efd73aab9c972fc26c6fc3214ff116ee8efb5
4
+ data.tar.gz: 46624f39aa0f20e909e5196b154fa10f37f05252
5
+ SHA512:
6
+ metadata.gz: f947e7826a2087f7b844214768835d5eea53a45e36998960db6369825f920b608cb97f772b90b80abc2bd647543082e353435be44d1ffa3b9569e80b88ff997a
7
+ data.tar.gz: e6cc5e33d0c31a7b33375b94149b1d440bb9157ea0f2c433160f7db4bb1f9184c3980447ab6c31ad8a6110a62092d31c590f762b9a9cb7ec3577efe4e755e128
data/.gitignore ADDED
@@ -0,0 +1,22 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ *.bundle
19
+ *.so
20
+ *.o
21
+ *.a
22
+ mkmf.log
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --color
2
+ --warnings
3
+ --require spec_helper
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright 2014 Ivan Ukhov
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,94 @@
1
+ # RSpec BDD
2
+
3
+ The library extends the DSL of [RSpec](https://github.com/rspec/rspec)
4
+ with the following methods:
5
+
6
+ * `background`,
7
+ * `given`,
8
+ * `feature`,
9
+ * `scenario`, and
10
+ * `shared_scenarios`.
11
+
12
+ ## Installation
13
+
14
+ In `Gemfile`:
15
+
16
+ ```ruby
17
+ gem 'rspec-bdd'
18
+ ```
19
+
20
+ ## Usage
21
+
22
+ Before:
23
+
24
+ ```ruby
25
+ RSpec.describe 'Awesome feature' do
26
+ before do
27
+ expect(true).to be true
28
+ end
29
+
30
+ let(:truth) { true }
31
+ let!(:lie) { false }
32
+
33
+ it 'Superb scenario' do
34
+ expect(truth).to be true
35
+ end
36
+
37
+ xit 'Bad scenario' do
38
+ expect(truth).to be false
39
+ end
40
+
41
+ shared_examples 'Comprehensive scenarios' do
42
+ it 'Handsome scenario' do
43
+ expect(lie).to be false
44
+ end
45
+ end
46
+
47
+ include_examples 'Comprehensive scenarios'
48
+ end
49
+ ```
50
+
51
+ After:
52
+
53
+ ```ruby
54
+ require 'rspec/bdd'
55
+
56
+ RSpec.feature 'Awesome feature' do
57
+ background do
58
+ expect(true).to be true
59
+ end
60
+
61
+ given(:truth) { true }
62
+ given!(:lie) { false }
63
+
64
+ scenario 'Superb scenario' do
65
+ expect(truth).to be true
66
+ end
67
+
68
+ xscenario 'Bad scenario' do
69
+ expect(truth).to be false
70
+ end
71
+
72
+ shared_scenarios 'Comprehensive scenarios' do
73
+ scenario 'Handsome scenario' do
74
+ expect(lie).to be false
75
+ end
76
+ end
77
+
78
+ include_scenarios 'Comprehensive scenarios'
79
+ end
80
+ ```
81
+
82
+ ## Acknowledgments
83
+
84
+ The library is inspired by [Capybara](https://github.com/jnicklas/capybara).
85
+
86
+ ## Contributing
87
+
88
+ 1. [Fork](https://help.github.com/articles/fork-a-repo) the project.
89
+ 2. Create a branch for your feature (`git checkout -b awesome-feature`).
90
+ 3. Implement your feature (`vim`).
91
+ 4. Commit your changes (`git commit -am 'Implemented an awesome feature'`).
92
+ 5. Push to the branch (`git push origin awesome-feature`).
93
+ 6. [Create](https://help.github.com/articles/creating-a-pull-request)
94
+ a new Pull Request.
data/Rakefile ADDED
@@ -0,0 +1,7 @@
1
+ require 'bundler/gem_tasks'
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
7
+ task :test => :spec
data/lib/rspec/bdd.rb ADDED
@@ -0,0 +1,24 @@
1
+ module RSpec
2
+ module BDD
3
+ def self.included(base)
4
+ base.shared_context 'Behavior-driven development', bdd: true do
5
+ instance_eval do
6
+ alias background before
7
+ alias given let
8
+ alias given! let!
9
+ alias shared_scenarios shared_examples
10
+ end
11
+ end
12
+
13
+ base.configure do |config|
14
+ config.alias_example_group_to :feature, bdd: true
15
+ config.alias_example_to :scenario
16
+ config.alias_example_to :xscenario,
17
+ skip: 'Temporarily skipped with xscenario'
18
+ config.alias_it_behaves_like_to :include_scenarios
19
+ end
20
+ end
21
+ end
22
+
23
+ include BDD
24
+ end
data/rspec-bdd.gemspec ADDED
@@ -0,0 +1,24 @@
1
+ lib = File.expand_path('../lib', __FILE__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+
4
+ Gem::Specification.new do |spec|
5
+ spec.name = 'rspec-bdd'
6
+ spec.version = '0.0.1'
7
+ spec.authors = [ 'Ivan Ukhov' ]
8
+ spec.email = [ 'ivan.ukhov@gmail.com' ]
9
+ spec.summary = 'Behavior-driven vocabulary for RSpec'
10
+ spec.description = 'The library extends the DSL of RSpec with ' \
11
+ 'given, background, feature, scenario, and ' \
12
+ 'shared_scenarios.'
13
+ spec.homepage = 'https://github.com/IvanUkhov/rspec-bdd'
14
+ spec.license = 'MIT'
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.test_files = spec.files.grep(%r{^spec/})
18
+ spec.require_paths = [ 'lib' ]
19
+
20
+ spec.add_dependency 'rspec', '~> 3.0'
21
+
22
+ spec.add_development_dependency 'bundler', '~> 1.6'
23
+ spec.add_development_dependency 'rake'
24
+ end
@@ -0,0 +1,27 @@
1
+ require 'spec_helper'
2
+ require 'rspec/bdd'
3
+
4
+ RSpec.feature 'Awesome feature' do
5
+ background do
6
+ expect(true).to be true
7
+ end
8
+
9
+ given(:truth) { true }
10
+ given!(:lie) { false }
11
+
12
+ scenario 'Superb scenario' do
13
+ expect(truth).to be true
14
+ end
15
+
16
+ xscenario 'Bad scenario' do
17
+ expect(truth).to be false
18
+ end
19
+
20
+ shared_scenarios 'Comprehensive scenarios' do
21
+ scenario 'Handsome scenario' do
22
+ expect(lie).to be false
23
+ end
24
+ end
25
+
26
+ include_scenarios 'Comprehensive scenarios'
27
+ end
@@ -0,0 +1,26 @@
1
+ require 'spec_helper'
2
+
3
+ RSpec.describe 'Awesome feature' do
4
+ before do
5
+ expect(true).to be true
6
+ end
7
+
8
+ let(:truth) { true }
9
+ let!(:lie) { false }
10
+
11
+ it 'Superb scenario' do
12
+ expect(truth).to be true
13
+ end
14
+
15
+ xit 'Bad scenario' do
16
+ expect(truth).to be false
17
+ end
18
+
19
+ shared_examples 'Comprehensive scenarios' do
20
+ it 'Handsome scenario' do
21
+ expect(lie).to be false
22
+ end
23
+ end
24
+
25
+ include_examples 'Comprehensive scenarios'
26
+ end
@@ -0,0 +1,3 @@
1
+ RSpec.configure do |config|
2
+ config.disable_monkey_patching!
3
+ end
metadata ADDED
@@ -0,0 +1,101 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rspec-bdd
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Ivan Ukhov
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-07-20 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rspec
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '3.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '3.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.6'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.6'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description: The library extends the DSL of RSpec with given, background, feature,
56
+ scenario, and shared_scenarios.
57
+ email:
58
+ - ivan.ukhov@gmail.com
59
+ executables: []
60
+ extensions: []
61
+ extra_rdoc_files: []
62
+ files:
63
+ - ".gitignore"
64
+ - ".rspec"
65
+ - Gemfile
66
+ - LICENSE.txt
67
+ - README.md
68
+ - Rakefile
69
+ - lib/rspec/bdd.rb
70
+ - rspec-bdd.gemspec
71
+ - spec/after_spec.rb
72
+ - spec/before_spec.rb
73
+ - spec/spec_helper.rb
74
+ homepage: https://github.com/IvanUkhov/rspec-bdd
75
+ licenses:
76
+ - MIT
77
+ metadata: {}
78
+ post_install_message:
79
+ rdoc_options: []
80
+ require_paths:
81
+ - lib
82
+ required_ruby_version: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
87
+ required_rubygems_version: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - ">="
90
+ - !ruby/object:Gem::Version
91
+ version: '0'
92
+ requirements: []
93
+ rubyforge_project:
94
+ rubygems_version: 2.2.2
95
+ signing_key:
96
+ specification_version: 4
97
+ summary: Behavior-driven vocabulary for RSpec
98
+ test_files:
99
+ - spec/after_spec.rb
100
+ - spec/before_spec.rb
101
+ - spec/spec_helper.rb