rspec-helpers 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: f19ef4b245318a1b1c8553be95ca3638b6ee9d5c
4
+ data.tar.gz: dc6bdbc24cfc5bb5840cb19d53d59c7a9bcf8f58
5
+ SHA512:
6
+ metadata.gz: 8e472f6cfd8397fa46e6a9555320b65fd981f93294ef18784e675010c8fb6e93ae5be837afa0846c8bcbebc4945fd4529239921346f3fe1bb67ce5eb3eadec9e
7
+ data.tar.gz: 0dabf23c7e491ef672ad5cfd4466615c9334d827c11f0cc0a7f960ccdfa63797dd8d918cdcfea2a262e331ebee144cd04718acaaeeb8ff2ac0d0ff2f1d8f91dc
data/Gemfile ADDED
@@ -0,0 +1,20 @@
1
+ # Frozen-string-literal: true
2
+ # Copyright: 2015-2016 Jordon Bedwell - MIT License
3
+ # Encoding: utf-8
4
+
5
+ source "https://rubygems.org"
6
+ gem "rake", :require => false
7
+ gemspec
8
+
9
+ group :test do
10
+ gem "codeclimate-test-reporter", {
11
+ :require => false
12
+ }
13
+ end
14
+
15
+ group :development do
16
+ gem "pry", :require => false
17
+ gem "luna-rspec-formatters", {
18
+ :require => false
19
+ }
20
+ end
data/LICENSE ADDED
@@ -0,0 +1,19 @@
1
+ Copyright (c) 2015-2016 Jordon Bedwell
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the "Software"),
5
+ to deal in the Software without restriction, including without limitation
6
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
7
+ and/or sell copies of the Software, and to permit persons to whom the
8
+ Software is furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included
11
+ in all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
14
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
18
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
19
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,10 @@
1
+ # Frozen-string-literal: true
2
+ # Copyright: 2015-2016 Jordon Bedwell - MIT License
3
+ # Encoding: utf-8
4
+
5
+ $LOAD_PATH.unshift(File.expand_path("../lib", __FILE__))
6
+ require "rspec/core/rake_task"
7
+
8
+ task :default => [:spec]
9
+ RSpec::Core::RakeTask.new :spec
10
+ task :test => :spec
@@ -0,0 +1,52 @@
1
+ # Frozen-string-literal: true
2
+ # Copyright: 2015-2016 Jordon Bedwell - MIT License
3
+ # Encoding: utf-8
4
+
5
+ require "rspec"
6
+
7
+ module RSpec
8
+ module Helpers
9
+ extend self
10
+
11
+ def silence_io(capture: false)
12
+ _stdout = $stdout # OG
13
+ _stderr = $stderr # OG
14
+ $stdout = StringIO.new
15
+ $stderr = StringIO.new
16
+
17
+ if !capture
18
+ yield
19
+ else
20
+ yield
21
+ return {
22
+ :stderr => $stderr.string,
23
+ :stdout => $stdout.string
24
+ }
25
+ end
26
+ ensure
27
+ $stdout = _stdout
28
+ $stderr = _stderr
29
+ end
30
+
31
+ #
32
+
33
+ def capture_io(&block)
34
+ silence_io(capture: true, &block)
35
+ end
36
+
37
+ #
38
+
39
+ module ClassMethods
40
+ def include_contexts(*contexts)
41
+ contexts.map do |val|
42
+ public_send(:include_context, val)
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
48
+
49
+ RSpec.configure do |config|
50
+ config.extend RSpec::Helpers::ClassMethods
51
+ config.include RSpec::Helpers
52
+ end
@@ -0,0 +1,9 @@
1
+ # Frozen-string-literal: true
2
+ # Copyright: 2015-2016 Jordon Bedwell - MIT License
3
+ # Encoding: utf-8
4
+
5
+ module RSpec
6
+ module Helpers
7
+ VERSION = "1.0.0"
8
+ end
9
+ end
metadata ADDED
@@ -0,0 +1,69 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rspec-helpers
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Jordon Bedwell
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-01-09 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
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '4.0'
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: '3.0'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '4.0'
33
+ description: A few helpers to make working with RSpec a bit cleaner.
34
+ email:
35
+ - jordon@envygeeks.io
36
+ executables: []
37
+ extensions: []
38
+ extra_rdoc_files: []
39
+ files:
40
+ - Gemfile
41
+ - LICENSE
42
+ - Rakefile
43
+ - lib/rspec/helpers.rb
44
+ - lib/rspec/helpers/version.rb
45
+ homepage: http://github.com/envygeeks/rspec-helpers
46
+ licenses:
47
+ - MIT
48
+ metadata: {}
49
+ post_install_message:
50
+ rdoc_options: []
51
+ require_paths:
52
+ - lib
53
+ required_ruby_version: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ version: '0'
58
+ required_rubygems_version: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ requirements: []
64
+ rubyforge_project:
65
+ rubygems_version: 2.5.1
66
+ signing_key:
67
+ specification_version: 4
68
+ summary: A few simple helpres to make working with RSpec a bit cleaner.
69
+ test_files: []