rspec-do_action 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -1
- data/Gemfile +1 -1
- data/README.md +9 -4
- data/gemfiles/rspec3_0.gemfile +6 -0
- data/gemfiles/rspec3_1.gemfile +6 -0
- data/lib/rspec-do_action.rb +3 -2
- data/lib/rspec-do_action/version.rb +1 -1
- data/rspec-do_action.gemspec +1 -1
- data/spec/lib/rspec-do_action_spec.rb +12 -2
- data/spec/spec_helper.rb +8 -3
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c5dbcee4b64e8651453ee9c38dc826417ebd1e04
|
4
|
+
data.tar.gz: 968047b467de563d641cb54c5d416f88c29f8fd1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 97665c6f71ce6a91c32cd7591d46d98b73481300917c7685ba09f3deea18bc0cc7a34835cfc9b15d1d646dc4b5d5c815df7b93b9dda11515427bc403aa06413c
|
7
|
+
data.tar.gz: e390e4328507f1a2433d1ebf98d6a3913e653191d37a1d1b7e497f22645d7a92cf8370457617d6eba61a04b9c5493c00ea8685cb6bf5b900e4253cec1f54c9e4
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
# Rspec::DoAction
|
1
|
+
# Rspec::DoAction
|
2
2
|
|
3
3
|
[![Build Status](https://travis-ci.org/sunteya/rspec-do_action.png?branch=master)](https://travis-ci.org/sunteya/rspec-do_action)
|
4
|
-
[![
|
5
|
-
[![
|
4
|
+
[![Code Climate](https://codeclimate.com/github/sunteya/rspec-do_action/badges/gpa.svg)](https://codeclimate.com/github/sunteya/rspec-do_action)
|
5
|
+
[![Test Coverage](https://codeclimate.com/github/sunteya/rspec-do_action/badges/coverage.svg)](https://codeclimate.com/github/sunteya/rspec-do_action)
|
6
6
|
[![Dependency Status](https://gemnasium.com/sunteya/rspec-do_action.png)](https://gemnasium.com/sunteya/rspec-do_action)
|
7
7
|
[![Gem Version](https://badge.fury.io/rb/rspec-do_action.png)](http://badge.fury.io/rb/rspec-do_action)
|
8
8
|
|
@@ -30,10 +30,15 @@ describe "explicit invoke 'do_action'" do
|
|
30
30
|
before { result << 1 }
|
31
31
|
do_action
|
32
32
|
before { result << 3 }
|
33
|
-
|
33
|
+
|
34
34
|
it { should eq [ 1, 2, 3 ] }
|
35
35
|
end
|
36
36
|
|
37
|
+
describe "skip auto 'do_action' invoke" do
|
38
|
+
action(skip: true) { raise RuntimeError }
|
39
|
+
it { expect{ do_action }.to raise_error }
|
40
|
+
end
|
41
|
+
|
37
42
|
describe "skip auto 'do_action' invoke" do
|
38
43
|
action { raise RuntimeError }
|
39
44
|
skip_do_action
|
data/lib/rspec-do_action.rb
CHANGED
@@ -31,7 +31,8 @@ module Rspec
|
|
31
31
|
end
|
32
32
|
|
33
33
|
module ClassMethods
|
34
|
-
def action(&block)
|
34
|
+
def action(options = {}, &block)
|
35
|
+
@skip_do_action = options[:skip]
|
35
36
|
@action = block
|
36
37
|
end
|
37
38
|
|
@@ -65,4 +66,4 @@ end
|
|
65
66
|
RSpec.configure do |config|
|
66
67
|
config.include Rspec::DoAction::InstanceMethods
|
67
68
|
config.extend Rspec::DoAction::ClassMethods
|
68
|
-
end
|
69
|
+
end
|
data/rspec-do_action.gemspec
CHANGED
@@ -23,13 +23,23 @@ describe Rspec::DoAction do
|
|
23
23
|
action { result << 0 }
|
24
24
|
it { should eq [ 0 ] }
|
25
25
|
end
|
26
|
-
|
26
|
+
|
27
27
|
context "with hooks" do
|
28
28
|
before { result << 1 }
|
29
29
|
it { should eq [ 1 , 2 ] }
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
33
|
+
describe "action with skip" do
|
34
|
+
action(skip: true) { result << 2 }
|
35
|
+
before { result << 1 }
|
36
|
+
it { should eq [ 1 ] }
|
37
|
+
|
38
|
+
context "when invoke in example" do
|
39
|
+
it { do_action; should eq [ 1, 2 ] }
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
33
43
|
describe "skip_do_action" do
|
34
44
|
action { result << 2 }
|
35
45
|
before { result << 1 }
|
@@ -50,4 +60,4 @@ describe Rspec::DoAction do
|
|
50
60
|
before { result << 1 }
|
51
61
|
it { should eq [ 1 ] }
|
52
62
|
end
|
53
|
-
end
|
63
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,10 +1,15 @@
|
|
1
|
+
if ENV["CODECLIMATE_REPO_TOKEN"]
|
2
|
+
require "codeclimate-test-reporter"
|
3
|
+
CodeClimate::TestReporter.start
|
4
|
+
else
|
5
|
+
require 'simplecov'
|
6
|
+
SimpleCov.start("test_frameworks")
|
7
|
+
end
|
8
|
+
|
1
9
|
require "rspec"
|
2
10
|
require "pry-nav"
|
3
11
|
require "rspec-do_action"
|
4
12
|
|
5
|
-
require 'coveralls'
|
6
|
-
Coveralls.wear!
|
7
|
-
|
8
13
|
RSpec.configure do |config|
|
9
14
|
config.treat_symbols_as_metadata_keys_with_true_values = true if RSpec::Version::STRING =~ /^2/
|
10
15
|
config.run_all_when_everything_filtered = true
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-do_action
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sunteya
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-07-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -67,7 +67,7 @@ dependencies:
|
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: codeclimate-test-reporter
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - ">="
|
@@ -95,6 +95,8 @@ files:
|
|
95
95
|
- README.md
|
96
96
|
- Rakefile
|
97
97
|
- gemfiles/rspec2.gemfile
|
98
|
+
- gemfiles/rspec3_0.gemfile
|
99
|
+
- gemfiles/rspec3_1.gemfile
|
98
100
|
- lib/rspec-do_action.rb
|
99
101
|
- lib/rspec-do_action/version.rb
|
100
102
|
- rspec-do_action.gemspec
|
@@ -121,7 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
121
123
|
version: '0'
|
122
124
|
requirements: []
|
123
125
|
rubyforge_project:
|
124
|
-
rubygems_version: 2.
|
126
|
+
rubygems_version: 2.5.2
|
125
127
|
signing_key:
|
126
128
|
specification_version: 4
|
127
129
|
summary: add 'acton' and some useful methods for rspec one-liner syntax.
|