forked from soveran/cuba
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
47 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
rvm 1.9.2@cuba |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
task :test do | ||
system "cd test && ruby cuba_test.rb" | ||
require "cutest" | ||
|
||
Cutest.run(Dir["test/*.rb"]) | ||
end | ||
|
||
task :default => :test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,12 +6,9 @@ Gem::Specification.new do |s| | |
s.authors = ["Michel Martens"] | ||
s.email = ["[email protected]"] | ||
s.homepage = "http://github.com/soveran/cuba" | ||
s.files = ["LICENSE", "README.markdown", "Rakefile", "lib/cuba/ron.rb", "lib/cuba/rum.rb", "lib/cuba/test.rb", "lib/cuba/version.rb", "lib/cuba.rb", "cuba.gemspec", "test/cuba_test.rb"] | ||
s.add_dependency "rack", ">= 1.1.0" | ||
s.add_dependency "haml", ">= 2.2.22" | ||
s.add_dependency "tilt", ">= 0.9" | ||
s.add_dependency "webrat", ">= 0.7.0" | ||
s.add_dependency "contest", ">= 0.1.2" | ||
s.add_dependency "stories", ">= 0.1.3" | ||
s.add_dependency "rack-test", ">= 0.5.3" | ||
s.files = ["LICENSE", "README.markdown", "Rakefile", "lib/cuba/ron.rb", "lib/cuba/rum.rb", "lib/cuba/test.rb", "lib/cuba/version.rb", "lib/cuba.rb", "cuba.gemspec", "test/cuba_test.rb", "test/webrat.log"] | ||
s.add_dependency "rack", "~> 1.2" | ||
s.add_dependency "tilt", "~> 1.1" | ||
s.add_development_dependency "cutest", "~> 0.1" | ||
s.add_development_dependency "capybara", "~> 0.1" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
task :default do | ||
require "cutest" | ||
|
||
Cutest.run(Dir["site_test.rb"]) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,15 @@ | ||
require "cuba/test" | ||
require "site" | ||
require File.expand_path("site", File.dirname(__FILE__)) | ||
|
||
Cuba.test "My Site" do | ||
story "As a user I want to be able to login" do | ||
scenario "A user submits good info" do | ||
visit "/" | ||
scope do | ||
test "Login" do | ||
visit "/" | ||
|
||
assert_contain "Hello World!" | ||
assert has_content?("Hello World!") | ||
|
||
fill_in "user", :with => "Michel" | ||
click_button "Login" | ||
fill_in "Your username", :with => "Michel" | ||
click_button "Login" | ||
|
||
assert_contain "Got Michel" | ||
end | ||
assert has_content?("Got Michel") | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<%= @greeting %> | ||
|
||
<form action="/login" method="post"> | ||
<label for="user">Your username</label> | ||
<input name="user" id="user"> | ||
<input type="submit" value="Login"> | ||
</form> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,9 @@ | ||
require "webrat" | ||
require "rack/test" | ||
require "stories" | ||
require "stories/runner" | ||
require "cuba" | ||
require "cutest" | ||
require "capybara/dsl" | ||
|
||
Webrat.configure do |config| | ||
config.mode = :rack | ||
class Cutest::Scope | ||
include Capybara | ||
end | ||
|
||
class Test::Unit::TestCase | ||
include Rack::Test::Methods | ||
include Webrat::Methods | ||
include Webrat::Matchers | ||
include Stories::Webrat | ||
|
||
def app | ||
Cuba | ||
end | ||
end | ||
|
||
module Cuba | ||
def self.test(name, &block) | ||
Test::Unit::TestCase.context(name, &block) | ||
end | ||
end | ||
Capybara.app = Cuba |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
test "examples" do | ||
`cd example && rake -I../lib` | ||
assert $?.exitstatus == 0 | ||
end |