-
Notifications
You must be signed in to change notification settings - Fork 1
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
tevio
committed
Dec 14, 2010
1 parent
ec18849
commit 0b15cfb
Showing
10 changed files
with
87 additions
and
8 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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
pkg/* | ||
*.gem | ||
.bundle | ||
.idea | ||
.idea | ||
tmp/* |
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,4 +6,5 @@ gemspec | |
group :test do | ||
#gem 'rails', '3.0.1' | ||
gem 'rspec' | ||
gem 'aruba' | ||
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,27 @@ | ||
Feature: | ||
In order to easily generate recurrence interfaces with their complex rest logic | ||
As a user of Rails3 | ||
I would like to use recurs generators | ||
|
||
Scenario: The recurs generators create a recurs scaffold | ||
for each model that I generate with a recurs generator | ||
Given I run "rails new test_app" | ||
And I cd to "test_app" | ||
And a file named "Gemfile" with: | ||
""" | ||
source "http://rubygems.org" | ||
gem 'rails', '3.0.0' | ||
gem 'sqlite3-ruby', :require => 'sqlite3' | ||
gem 'recurs', :path => '../../../' | ||
""" | ||
And I run "bundle install" | ||
And I run "rails generate recurs_widget Event" | ||
And I run "rake db:migrate" | ||
And the following files should exist: | ||
| app/models/event.rb | | ||
| app/views/events/index.html.haml | | ||
| app/views/events/new.html.haml | | ||
| app/views/events/edit.html.haml | | ||
| app/views/events/_form.html.haml | | ||
And the following files should not exist: | ||
| test/fixtures/users.yml | |
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,24 @@ | ||
When /^I do aruba (.*)$/ do |aruba_step| | ||
begin | ||
When(aruba_step) | ||
rescue => e | ||
@aruba_exception = e | ||
end | ||
end | ||
|
||
# Useful for debugging timing problems | ||
When /^sleep (\d+)$/ do |time| | ||
sleep time.to_i | ||
end | ||
|
||
Then /^aruba should fail with "([^"]*)"$/ do |error_message| | ||
@aruba_exception.message.should include(unescape(error_message)) | ||
end | ||
|
||
Then /^the following step should fail with Spec::Expectations::ExpectationNotMetError:$/ do |multiline_step| | ||
proc {steps multiline_step}.should raise_error(RSpec::Expectations::ExpectationNotMetError) | ||
end | ||
|
||
Then /^the output should be (\d+) bytes long$/ do |length| | ||
all_output.chomp.length.should == length.to_i | ||
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 @@ | ||
require 'aruba' |
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,15 @@ | ||
$LOAD_PATH.unshift(File.dirname(__FILE__) + '/../../lib') | ||
require 'aruba/cucumber' | ||
require 'fileutils' | ||
|
||
begin | ||
# rspec-2 | ||
require 'rspec/expectations' | ||
rescue LoadError | ||
# rspec-1 | ||
require 'spec/expectations' | ||
end | ||
|
||
Before do | ||
FileUtils.rm(Dir['config/*.yml']) | ||
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,9 @@ | ||
class RecursInstanceGenerator < Rails::Generators::Base | ||
source_root File.expand_path("../templates", __FILE__) | ||
argument :name, :type => :string, :default => "event" | ||
|
||
def create_instance_model | ||
template "instance.rb.tmpl", "app/models/#{name}.rb" | ||
#create_file "app/models#{model_name}" | ||
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,3 @@ | ||
class <%= name.classify %> < ActiveRecord::Base | ||
acts_as_recurring | ||
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