rspec-do_action 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cdd88582eefbbda5380d591287cf680e04f7aef4
4
- data.tar.gz: 2be1cbd7f7ccfe6ddf12ec7c5d79ad43fd5bc185
3
+ metadata.gz: c5dbcee4b64e8651453ee9c38dc826417ebd1e04
4
+ data.tar.gz: 968047b467de563d641cb54c5d416f88c29f8fd1
5
5
  SHA512:
6
- metadata.gz: 9bc561ed9b20ec45d35e678361c92a7acd84738701803c6537260a35879a9e14938484c7adf35802925199adffda3afae673ebee4c7dec5e159319966491d540
7
- data.tar.gz: 3cb6f3204fa1e2b65665f9a2a16b6aed18b954b8d8fb53cc185294c4635c712dbfd0da4345a21eabb9e10123f703bd51a7abd125393ca7c5ca8d72105d1de0fe
6
+ metadata.gz: 97665c6f71ce6a91c32cd7591d46d98b73481300917c7685ba09f3deea18bc0cc7a34835cfc9b15d1d646dc4b5d5c815df7b93b9dda11515427bc403aa06413c
7
+ data.tar.gz: e390e4328507f1a2433d1ebf98d6a3913e653191d37a1d1b7e497f22645d7a92cf8370457617d6eba61a04b9c5493c00ea8685cb6bf5b900e4253cec1f54c9e4
data/.travis.yml CHANGED
@@ -5,4 +5,6 @@ rvm:
5
5
  - 1.9.3
6
6
  gemfile:
7
7
  - Gemfile
8
- - gemfiles/rspec2.gemfile
8
+ - gemfiles/rspec2.gemfile
9
+ - gemfiles/rspec3_0.gemfile
10
+ - gemfiles/rspec3_1.gemfile
data/Gemfile CHANGED
@@ -1,5 +1,5 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in rspec-do_action.gemspec
4
- gem "rspec", "~> 3.0.0"
4
+ gem "rspec", ">= 3.0.0"
5
5
  gemspec
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
- [![Coverage Status](https://coveralls.io/repos/sunteya/rspec-do_action/badge.png)](https://coveralls.io/r/sunteya/rspec-do_action)
5
- [![Code Climate](https://codeclimate.com/github/sunteya/rspec-do_action.png)](https://codeclimate.com/github/sunteya/rspec-do_action)
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
@@ -0,0 +1,6 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem "rspec", "~> 3.0.0"
4
+
5
+ # Specify your gem's dependencies in rspec-do_action.gemspec
6
+ gemspec path: '..'
@@ -0,0 +1,6 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem "rspec", "~> 3.1.0"
4
+
5
+ # Specify your gem's dependencies in rspec-do_action.gemspec
6
+ gemspec path: '..'
@@ -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
@@ -1,5 +1,5 @@
1
1
  module Rspec
2
2
  module DoAction
3
- VERSION = "0.0.4"
3
+ VERSION = "0.0.5"
4
4
  end
5
5
  end
@@ -23,5 +23,5 @@ Gem::Specification.new do |spec|
23
23
 
24
24
  spec.add_development_dependency "rspec"
25
25
  spec.add_development_dependency "pry-nav"
26
- spec.add_development_dependency "coveralls"
26
+ spec.add_development_dependency "codeclimate-test-reporter"
27
27
  end
@@ -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
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: 2014-08-18 00:00:00.000000000 Z
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: coveralls
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.2.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.