rspec-aspic 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +28 -2
- data/lib/rspec-aspic.rb +10 -1
- metadata +37 -63
data/README.md
CHANGED
@@ -36,7 +36,7 @@ Usage
|
|
36
36
|
|
37
37
|
Currently, Aspic only contain one helper.
|
38
38
|
|
39
|
-
|
39
|
+
###the
|
40
40
|
|
41
41
|
```ruby
|
42
42
|
describe "POST /categories" do
|
@@ -47,7 +47,7 @@ describe "POST /categories" do
|
|
47
47
|
end
|
48
48
|
```
|
49
49
|
|
50
|
-
|
50
|
+
*is the equivalent of*
|
51
51
|
|
52
52
|
```ruby
|
53
53
|
describe "POST /categories" do
|
@@ -65,6 +65,32 @@ describe "POST /categories" do
|
|
65
65
|
end
|
66
66
|
```
|
67
67
|
|
68
|
+
###fixture
|
69
|
+
|
70
|
+
```ruby
|
71
|
+
describe "fixture" do
|
72
|
+
fixture :fx, { 'items' => [1,2,3] } do
|
73
|
+
it { should_not be_empty }
|
74
|
+
the("fx['items']") { should eql [1,2,3] }
|
75
|
+
end
|
76
|
+
end
|
77
|
+
```
|
78
|
+
|
79
|
+
*is the equivalent of*
|
80
|
+
|
81
|
+
```ruby
|
82
|
+
describe "fixture" do
|
83
|
+
context "with the fixture fx {'items'=>[1,2,3]}" do
|
84
|
+
let(:fx) { {'items'=>[1,2,3]} }
|
85
|
+
|
86
|
+
subject { fx }
|
87
|
+
|
88
|
+
it { should_not be_empty }
|
89
|
+
the("fx['items']") { should eql [1,2,3] }
|
90
|
+
end
|
91
|
+
end
|
92
|
+
```
|
93
|
+
|
68
94
|
Copyright
|
69
95
|
---------
|
70
96
|
|
data/lib/rspec-aspic.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
module RSpecAspic
|
2
2
|
def self.included(klass)
|
3
3
|
klass.extend(InstanceMethods)
|
4
|
-
klass.send(:include, ClassMethods)
|
5
4
|
end
|
6
5
|
|
7
6
|
module InstanceMethods
|
@@ -11,5 +10,15 @@ module RSpecAspic
|
|
11
10
|
it(&block)
|
12
11
|
end
|
13
12
|
end
|
13
|
+
|
14
|
+
def fixture(name, value, &block)
|
15
|
+
context "with the fixture #{name} : #{value.inspect}" do
|
16
|
+
let(name) { value }
|
17
|
+
|
18
|
+
subject { send(name) }
|
19
|
+
|
20
|
+
self.instance_exec &block
|
21
|
+
end
|
22
|
+
end
|
14
23
|
end
|
15
24
|
end
|
metadata
CHANGED
@@ -1,101 +1,75 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-aspic
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 0
|
9
|
-
- 1
|
10
|
-
version: 0.0.1
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Sebastien Rosa
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2012-04-11 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
21
15
|
name: rake
|
22
|
-
|
23
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: &2165182680 !ruby/object:Gem::Requirement
|
24
17
|
none: false
|
25
|
-
requirements:
|
26
|
-
- -
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
hash: 49
|
29
|
-
segments:
|
30
|
-
- 0
|
31
|
-
- 8
|
32
|
-
- 7
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
33
21
|
version: 0.8.7
|
34
22
|
type: :development
|
35
|
-
version_requirements: *id001
|
36
|
-
- !ruby/object:Gem::Dependency
|
37
|
-
name: rspec
|
38
23
|
prerelease: false
|
39
|
-
|
24
|
+
version_requirements: *2165182680
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: rspec
|
27
|
+
requirement: &2165182040 !ruby/object:Gem::Requirement
|
40
28
|
none: false
|
41
|
-
requirements:
|
42
|
-
- -
|
43
|
-
- !ruby/object:Gem::Version
|
44
|
-
|
45
|
-
segments:
|
46
|
-
- 2
|
47
|
-
- 0
|
48
|
-
version: "2.0"
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '2.0'
|
49
33
|
type: :development
|
50
|
-
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *2165182040
|
51
36
|
description: Various tools for RSpec
|
52
|
-
email:
|
37
|
+
email:
|
53
38
|
- sebastien@demarque.com
|
54
39
|
executables: []
|
55
|
-
|
56
40
|
extensions: []
|
57
|
-
|
58
|
-
extra_rdoc_files:
|
41
|
+
extra_rdoc_files:
|
59
42
|
- LICENSE
|
60
43
|
- README.md
|
61
|
-
files:
|
44
|
+
files:
|
62
45
|
- lib/rspec-aspic.rb
|
63
46
|
- LICENSE
|
64
47
|
- README.md
|
65
48
|
- Rakefile
|
66
49
|
- Gemfile
|
67
50
|
homepage: https://github.com/demarque/rspec-aspic
|
68
|
-
licenses:
|
51
|
+
licenses:
|
69
52
|
- MIT
|
70
53
|
post_install_message:
|
71
54
|
rdoc_options: []
|
72
|
-
|
73
|
-
require_paths:
|
55
|
+
require_paths:
|
74
56
|
- lib
|
75
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
57
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
76
58
|
none: false
|
77
|
-
requirements:
|
78
|
-
- -
|
79
|
-
- !ruby/object:Gem::Version
|
80
|
-
|
81
|
-
|
82
|
-
- 0
|
83
|
-
version: "0"
|
84
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - ! '>='
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
63
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
85
64
|
none: false
|
86
|
-
requirements:
|
87
|
-
- -
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
|
90
|
-
segments:
|
91
|
-
- 0
|
92
|
-
version: "0"
|
65
|
+
requirements:
|
66
|
+
- - ! '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
93
69
|
requirements: []
|
94
|
-
|
95
70
|
rubyforge_project: rspec-aspic
|
96
|
-
rubygems_version: 1.8.
|
71
|
+
rubygems_version: 1.8.17
|
97
72
|
signing_key:
|
98
73
|
specification_version: 3
|
99
74
|
summary: Various tools for RSpec
|
100
75
|
test_files: []
|
101
|
-
|