rspec-aspic 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. data/Gemfile +4 -0
  2. data/LICENSE +7 -0
  3. data/README.md +71 -0
  4. data/Rakefile +1 -0
  5. data/lib/rspec-aspic.rb +15 -0
  6. metadata +101 -0
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in rspec-aspic.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,7 @@
1
+ Copyright (c) 2012 De Marque inc.
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,71 @@
1
+ RSpec Aspic
2
+ ===============
3
+
4
+ Various tools for RSpec
5
+
6
+ Install
7
+ -------
8
+
9
+ ```
10
+ gem install rspec-aspic
11
+ ```
12
+
13
+ Rails 3
14
+ -------
15
+
16
+ In your Gemfile:
17
+
18
+ ```ruby
19
+ group :test do
20
+ gem "rspec-aspic"
21
+ end
22
+ ```
23
+
24
+ In your spec_helper.rb:
25
+
26
+ ```ruby
27
+ require 'rspec-aspic'
28
+
29
+ RSpec.configure do |config|
30
+ config.include RSpecAspic
31
+ end
32
+ ```
33
+
34
+ Usage
35
+ -----
36
+
37
+ Currently, Aspic only contain one helper.
38
+
39
+ **the**
40
+
41
+ ```ruby
42
+ describe "POST /categories" do
43
+ before { post "/categories" }
44
+
45
+ the(:last_response) { should be_ok }
46
+ the('Category.count') { should eql 2 }
47
+ end
48
+ ```
49
+
50
+ ... is the equivalent of ...
51
+
52
+ ```ruby
53
+ describe "POST /categories" do
54
+ before { post "/categories" }
55
+
56
+ context "last_response" do
57
+ subject { last_response }
58
+ it { should be_ok }
59
+ end
60
+
61
+ context "Category.count" do
62
+ subject { Category.count }
63
+ it { should eql 2 }
64
+ end
65
+ end
66
+ ```
67
+
68
+ Copyright
69
+ ---------
70
+
71
+ Copyright (c) 2012 De Marque inc. See LICENSE for further details.
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,15 @@
1
+ module RSpecAspic
2
+ def self.included(klass)
3
+ klass.extend(InstanceMethods)
4
+ klass.send(:include, ClassMethods)
5
+ end
6
+
7
+ module InstanceMethods
8
+ def the(attribute, &block)
9
+ context "#{attribute}" do
10
+ subject { eval("#{attribute}") }
11
+ it(&block)
12
+ end
13
+ end
14
+ end
15
+ end
metadata ADDED
@@ -0,0 +1,101 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rspec-aspic
3
+ version: !ruby/object:Gem::Version
4
+ hash: 29
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 1
10
+ version: 0.0.1
11
+ platform: ruby
12
+ authors:
13
+ - Sebastien Rosa
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2012-04-07 00:00:00 Z
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: rake
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ hash: 49
29
+ segments:
30
+ - 0
31
+ - 8
32
+ - 7
33
+ version: 0.8.7
34
+ type: :development
35
+ version_requirements: *id001
36
+ - !ruby/object:Gem::Dependency
37
+ name: rspec
38
+ prerelease: false
39
+ requirement: &id002 !ruby/object:Gem::Requirement
40
+ none: false
41
+ requirements:
42
+ - - ">="
43
+ - !ruby/object:Gem::Version
44
+ hash: 3
45
+ segments:
46
+ - 2
47
+ - 0
48
+ version: "2.0"
49
+ type: :development
50
+ version_requirements: *id002
51
+ description: Various tools for RSpec
52
+ email:
53
+ - sebastien@demarque.com
54
+ executables: []
55
+
56
+ extensions: []
57
+
58
+ extra_rdoc_files:
59
+ - LICENSE
60
+ - README.md
61
+ files:
62
+ - lib/rspec-aspic.rb
63
+ - LICENSE
64
+ - README.md
65
+ - Rakefile
66
+ - Gemfile
67
+ homepage: https://github.com/demarque/rspec-aspic
68
+ licenses:
69
+ - MIT
70
+ post_install_message:
71
+ rdoc_options: []
72
+
73
+ require_paths:
74
+ - lib
75
+ required_ruby_version: !ruby/object:Gem::Requirement
76
+ none: false
77
+ requirements:
78
+ - - ">="
79
+ - !ruby/object:Gem::Version
80
+ hash: 3
81
+ segments:
82
+ - 0
83
+ version: "0"
84
+ required_rubygems_version: !ruby/object:Gem::Requirement
85
+ none: false
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ hash: 3
90
+ segments:
91
+ - 0
92
+ version: "0"
93
+ requirements: []
94
+
95
+ rubyforge_project: rspec-aspic
96
+ rubygems_version: 1.8.15
97
+ signing_key:
98
+ specification_version: 3
99
+ summary: Various tools for RSpec
100
+ test_files: []
101
+