unencumbered 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.gitignore +5 -0
- data/LICENSE +20 -0
- data/README.textile +89 -0
- data/Rakefile +16 -0
- data/VERSION +1 -0
- data/lib/unencumbered.rb +51 -0
- data/unencumbered.gemspec +45 -0
- metadata +63 -0
data/.document
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2009 Hashrocket
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.textile
ADDED
@@ -0,0 +1,89 @@
|
|
1
|
+
h1. Unencumbered
|
2
|
+
|
3
|
+
_You got Cucumber in my RSpec!_
|
4
|
+
|
5
|
+
Write Cucumber-flavored integration tests as easily as you write your RSpec.
|
6
|
+
|
7
|
+
h2. To Get Output Like This
|
8
|
+
|
9
|
+
Output from a @rake spec:integration@ run:
|
10
|
+
|
11
|
+
<pre>
|
12
|
+
<code>
|
13
|
+
User creates a vurl
|
14
|
+
Scenario: creating
|
15
|
+
Given I am on the home page
|
16
|
+
When I submit a valid vurl
|
17
|
+
Then I should be on vurl stats page
|
18
|
+
And I should see a success message
|
19
|
+
And my vurl was successfully created
|
20
|
+
</code>
|
21
|
+
</pre>
|
22
|
+
|
23
|
+
h2. Make a Feature Like This
|
24
|
+
|
25
|
+
Put it in a spec file in the _spec/integration_ folder. Here's
|
26
|
+
_user_creates_vurl_spec.rb_ for example:
|
27
|
+
|
28
|
+
<pre>
|
29
|
+
<code>
|
30
|
+
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
|
31
|
+
|
32
|
+
Feature "User creates a vurl" do
|
33
|
+
Scenario "creating" do
|
34
|
+
Given "I am on the home page" do
|
35
|
+
executes { visit root_path }
|
36
|
+
|
37
|
+
When "I submit a valid vurl" do
|
38
|
+
executes do
|
39
|
+
fill_in "vurl_url", :with => 'http://example.com'
|
40
|
+
click_button 'Vurlify!'
|
41
|
+
end
|
42
|
+
|
43
|
+
Then "I should be on the vurl stats page" do
|
44
|
+
current_url.should == stats_url(Vurl.last.slug)
|
45
|
+
end
|
46
|
+
|
47
|
+
And "I should see a success message" do
|
48
|
+
response.body.should include('Vurl was successfully created')
|
49
|
+
end
|
50
|
+
|
51
|
+
And "my vurl was created" do
|
52
|
+
Vurl.last.url.should == 'http://example.com'
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
</code>
|
59
|
+
</pre>
|
60
|
+
|
61
|
+
h2. Set Up
|
62
|
+
|
63
|
+
h3. Environment
|
64
|
+
|
65
|
+
Add this line to your _config/environments/test.rb_ file. Make sure to use the
|
66
|
+
@:lib => false@ item. We need to require the library manually in the
|
67
|
+
_spec_helper.rb_, since it patches RSpec.
|
68
|
+
|
69
|
+
<pre>
|
70
|
+
<code>
|
71
|
+
config.gem "unencumbered", :lib => false, :version => '>= 0.x.x'
|
72
|
+
</code>
|
73
|
+
</pre>
|
74
|
+
|
75
|
+
|
76
|
+
h3. spec_helper.rb
|
77
|
+
|
78
|
+
Meld these lines into your existing _spec/spec_helper.rb_. The _unencumbered_
|
79
|
+
require needs to be last, since it patches RSpec.
|
80
|
+
|
81
|
+
<pre>
|
82
|
+
<code>
|
83
|
+
require 'webrat'
|
84
|
+
require 'unencumbered'
|
85
|
+
</code>
|
86
|
+
</pre>
|
87
|
+
|
88
|
+
|
89
|
+
Copyright (c) 2009 Hashrocket. See LICENSE for details.
|
data/Rakefile
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'jeweler'
|
6
|
+
Jeweler::Tasks.new do |gem|
|
7
|
+
gem.name = "unencumbered"
|
8
|
+
gem.summary = %Q{Just enough Cucumber in RSpec.}
|
9
|
+
gem.description = %Q{You got Cucumber in my RSpec!}
|
10
|
+
gem.email = "info@hashrocket.com"
|
11
|
+
gem.homepage = "http://github.com/hashrocket/unencumbered"
|
12
|
+
gem.authors = ["Hashrocket"]
|
13
|
+
end
|
14
|
+
rescue LoadError
|
15
|
+
puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
|
16
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.0.5
|
data/lib/unencumbered.rb
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
module Spec::DSL::Main
|
2
|
+
alias :Feature :describe
|
3
|
+
end
|
4
|
+
|
5
|
+
module Spec::Example::ExampleGroupMethods
|
6
|
+
def Scenario(description, &blk)
|
7
|
+
describe("Scenario: #{description}", &blk)
|
8
|
+
end
|
9
|
+
|
10
|
+
def Given(description, &blk)
|
11
|
+
describe("Given #{description}", &blk)
|
12
|
+
end
|
13
|
+
|
14
|
+
def When(description, &blk)
|
15
|
+
describe("When #{description}", &blk)
|
16
|
+
end
|
17
|
+
|
18
|
+
def Then(description, &blk)
|
19
|
+
example("Then #{description}", &blk)
|
20
|
+
end
|
21
|
+
|
22
|
+
def And(description, &blk)
|
23
|
+
example("And #{description}", &blk)
|
24
|
+
end
|
25
|
+
|
26
|
+
def executes(scope=:all, &blk)
|
27
|
+
before(scope, &blk)
|
28
|
+
end
|
29
|
+
|
30
|
+
def Background(description, &blk)
|
31
|
+
describe("Background #{description}", &blk)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
if defined? ActionController::Integration::Session
|
36
|
+
class ActionController::Integration::Session
|
37
|
+
include Spec::Matchers
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
if defined? Webrat
|
42
|
+
Webrat.configure do |config|
|
43
|
+
config.mode = :rails
|
44
|
+
end
|
45
|
+
|
46
|
+
if defined? Spec::Runner
|
47
|
+
Spec::Runner.configure do |config|
|
48
|
+
config.include(Webrat::Matchers, :type => [:integration])
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{unencumbered}
|
8
|
+
s.version = "0.0.5"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Hashrocket"]
|
12
|
+
s.date = %q{2009-10-29}
|
13
|
+
s.description = %q{You got Cucumber in my RSpec!}
|
14
|
+
s.email = %q{info@hashrocket.com}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE",
|
17
|
+
"README.textile"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
".document",
|
21
|
+
".gitignore",
|
22
|
+
"LICENSE",
|
23
|
+
"README.textile",
|
24
|
+
"Rakefile",
|
25
|
+
"VERSION",
|
26
|
+
"lib/unencumbered.rb",
|
27
|
+
"unencumbered.gemspec"
|
28
|
+
]
|
29
|
+
s.homepage = %q{http://github.com/hashrocket/unencumbered}
|
30
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
31
|
+
s.require_paths = ["lib"]
|
32
|
+
s.rubygems_version = %q{1.3.5}
|
33
|
+
s.summary = %q{Just enough Cucumber in RSpec.}
|
34
|
+
|
35
|
+
if s.respond_to? :specification_version then
|
36
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
37
|
+
s.specification_version = 3
|
38
|
+
|
39
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
40
|
+
else
|
41
|
+
end
|
42
|
+
else
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
metadata
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: unencumbered
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.5
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Hashrocket
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-10-29 00:00:00 -04:00
|
13
|
+
default_executable:
|
14
|
+
dependencies: []
|
15
|
+
|
16
|
+
description: You got Cucumber in my RSpec!
|
17
|
+
email: info@hashrocket.com
|
18
|
+
executables: []
|
19
|
+
|
20
|
+
extensions: []
|
21
|
+
|
22
|
+
extra_rdoc_files:
|
23
|
+
- LICENSE
|
24
|
+
- README.textile
|
25
|
+
files:
|
26
|
+
- .document
|
27
|
+
- .gitignore
|
28
|
+
- LICENSE
|
29
|
+
- README.textile
|
30
|
+
- Rakefile
|
31
|
+
- VERSION
|
32
|
+
- lib/unencumbered.rb
|
33
|
+
- unencumbered.gemspec
|
34
|
+
has_rdoc: true
|
35
|
+
homepage: http://github.com/hashrocket/unencumbered
|
36
|
+
licenses: []
|
37
|
+
|
38
|
+
post_install_message:
|
39
|
+
rdoc_options:
|
40
|
+
- --charset=UTF-8
|
41
|
+
require_paths:
|
42
|
+
- lib
|
43
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: "0"
|
48
|
+
version:
|
49
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: "0"
|
54
|
+
version:
|
55
|
+
requirements: []
|
56
|
+
|
57
|
+
rubyforge_project:
|
58
|
+
rubygems_version: 1.3.5
|
59
|
+
signing_key:
|
60
|
+
specification_version: 3
|
61
|
+
summary: Just enough Cucumber in RSpec.
|
62
|
+
test_files: []
|
63
|
+
|