Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fixed the rack_datamapper naming problem
* added integration test * added monkey patch to let generated views spec work with datamapper
- Loading branch information
Showing
10 changed files
with
130 additions
and
213 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,2 +1,3 @@ | ||
pkg | ||
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
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
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,45 @@ | ||
module Datamapper4Rails | ||
class IntegrationTest | ||
|
||
attr_accessor :generator_args | ||
|
||
attr_accessor :rails_template | ||
|
||
attr_accessor :directory | ||
|
||
def initialize | ||
@ruby = RUBY_PLATFORM =~ /java/ ? 'jruby' : 'ruby' | ||
@directory = 'tmp' | ||
@generator_args = [] | ||
@rails_template = 'datamapper_rails_templates.rb' | ||
yield self if block_given? | ||
execute | ||
end | ||
|
||
def generate(*args) | ||
@generator_args << args.map(&:to_s).join(" ") | ||
end | ||
|
||
def execute | ||
FileUtils.rm_rf(@directory) | ||
run("-S rails -fm #{rails_template} #{directory}") | ||
FileUtils.cd(@directory) do | ||
@generator_args.each do |arg| | ||
run("script/generate #{arg}") | ||
end | ||
run("-S rake spec") | ||
#run("-S rake test:units") | ||
end | ||
|
||
end | ||
|
||
def run(command) | ||
unless system("#{@ruby} #{command}") | ||
puts | ||
puts "error in: #{@ruby} #{command}" | ||
exit 1 | ||
end | ||
end | ||
|
||
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
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,8 @@ | ||
module DataMapper | ||
module Resource | ||
|
||
def has_attribute?(name) | ||
properties[name] != nil | ||
end | ||
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
class Datamapper4rails | ||
VERSION = '0.2.0' | ||
VERSION = '0.2.0'.freeze | ||
end |
Oops, something went wrong.