rspec-action 1.0.0 → 1.1.0
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.
- data/CHANGELOG +4 -0
- data/README.markdown +3 -0
- data/lib/rspec-action/version.rb +1 -1
- data/lib/rspec-action.rb +4 -4
- data/rspec-action.gemspec +1 -1
- metadata +12 -14
data/CHANGELOG
CHANGED
data/README.markdown
CHANGED
|
@@ -10,6 +10,9 @@ An extension to rspec, which provides an `action` command to rspec examples
|
|
|
10
10
|
rspec-action is an extension to rspec2, which allows you to specify the last before hook.
|
|
11
11
|
I named it `action`, because it's quite helpful for me in the controller specs.
|
|
12
12
|
|
|
13
|
+
*IMPORTANT*
|
|
14
|
+
Use rspec-action 1.0.0 for Rspec 2.11 or lower.
|
|
15
|
+
|
|
13
16
|
I prefer to write
|
|
14
17
|
|
|
15
18
|
describe "GET index" do
|
data/lib/rspec-action/version.rb
CHANGED
data/lib/rspec-action.rb
CHANGED
|
@@ -17,14 +17,14 @@ module RSpec
|
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
def remove_previous_action(&block)
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
parent_groups.each do |parent|
|
|
21
|
+
parent.hooks[:before][:each].delete_if {|hook| hook.respond_to?(:action_hook?)}
|
|
22
22
|
end
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
def action_added?(&block)
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
parent_groups_hooks = parent_groups.reverse.map { |parent| parent.hooks[:before][:each] }.flatten
|
|
27
|
+
parent_groups_hooks.map(&:to_proc).include? block
|
|
28
28
|
end
|
|
29
29
|
end
|
|
30
30
|
end
|
data/rspec-action.gemspec
CHANGED
|
@@ -18,6 +18,6 @@ Gem::Specification.new do |s|
|
|
|
18
18
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
|
19
19
|
s.require_paths = ["lib"]
|
|
20
20
|
|
|
21
|
-
s.add_dependency "rspec", "~> 2.
|
|
21
|
+
s.add_dependency "rspec", "~> 2.12"
|
|
22
22
|
s.add_development_dependency "rake"
|
|
23
23
|
end
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rspec-action
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
hash:
|
|
4
|
+
hash: 19
|
|
5
5
|
prerelease:
|
|
6
6
|
segments:
|
|
7
7
|
- 1
|
|
8
|
+
- 1
|
|
8
9
|
- 0
|
|
9
|
-
|
|
10
|
-
version: 1.0.0
|
|
10
|
+
version: 1.1.0
|
|
11
11
|
platform: ruby
|
|
12
12
|
authors:
|
|
13
13
|
- Alexander Glushkov
|
|
@@ -15,28 +15,27 @@ autorequire:
|
|
|
15
15
|
bindir: bin
|
|
16
16
|
cert_chain: []
|
|
17
17
|
|
|
18
|
-
date: 2012-
|
|
19
|
-
default_executable:
|
|
18
|
+
date: 2012-11-30 00:00:00 Z
|
|
20
19
|
dependencies:
|
|
21
20
|
- !ruby/object:Gem::Dependency
|
|
22
21
|
name: rspec
|
|
23
22
|
prerelease: false
|
|
24
|
-
|
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
|
25
24
|
none: false
|
|
26
25
|
requirements:
|
|
27
26
|
- - ~>
|
|
28
27
|
- !ruby/object:Gem::Version
|
|
29
|
-
hash:
|
|
28
|
+
hash: 27
|
|
30
29
|
segments:
|
|
31
30
|
- 2
|
|
32
|
-
-
|
|
33
|
-
version: "2.
|
|
34
|
-
requirement: *id001
|
|
31
|
+
- 12
|
|
32
|
+
version: "2.12"
|
|
35
33
|
type: :runtime
|
|
34
|
+
version_requirements: *id001
|
|
36
35
|
- !ruby/object:Gem::Dependency
|
|
37
36
|
name: rake
|
|
38
37
|
prerelease: false
|
|
39
|
-
|
|
38
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
|
40
39
|
none: false
|
|
41
40
|
requirements:
|
|
42
41
|
- - ">="
|
|
@@ -45,8 +44,8 @@ dependencies:
|
|
|
45
44
|
segments:
|
|
46
45
|
- 0
|
|
47
46
|
version: "0"
|
|
48
|
-
requirement: *id002
|
|
49
47
|
type: :development
|
|
48
|
+
version_requirements: *id002
|
|
50
49
|
description: "Adds an \"action\" method to rspec examples, which is a last \"before\" in fact "
|
|
51
50
|
email:
|
|
52
51
|
- cutalion@gmail.com
|
|
@@ -68,7 +67,6 @@ files:
|
|
|
68
67
|
- rspec-action.gemspec
|
|
69
68
|
- spec/lib/rspec-action_spec.rb
|
|
70
69
|
- spec/spec_helper.rb
|
|
71
|
-
has_rdoc: true
|
|
72
70
|
homepage: ""
|
|
73
71
|
licenses: []
|
|
74
72
|
|
|
@@ -98,7 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
98
96
|
requirements: []
|
|
99
97
|
|
|
100
98
|
rubyforge_project: rspec-action
|
|
101
|
-
rubygems_version: 1.
|
|
99
|
+
rubygems_version: 1.8.24
|
|
102
100
|
signing_key:
|
|
103
101
|
specification_version: 3
|
|
104
102
|
summary: Adds an "action" method to rspec examples
|