require File.expand_path(File.join(File.dirname(__FILE__), 'spec_helper.rb')) require 'maven/tools/rails_project' describe Maven::Tools::RailsProject do before :each do @project = Maven::Tools::RailsProject.new("test") end it 'should load Gemfile from a simple rails application with applied defaults' do @project.load_gemfile(File.join(File.dirname(__FILE__), 'Gemfile.simple')) @project.name "test" @project.add_defaults @project.to_xml.should == <<-XML 4.0.0 rails test 0.0.0 war rubygems-releases http://rubygems-proxy.torquebox.org/releases rubygems rails 3.0.1 gem #{ !defined?(JRUBY_VERSION) ? '' : ' rubygems activerecord-jdbc-adapter [0,) gem ' } rubygems #{ defined?(JRUBY_VERSION) ? 'jdbc-' : ''}sqlite3 [0,) gem rubygems bundler gem org.jruby jruby-complete ${jruby.version} jar org.jruby.rack jruby-rack _jruby.rack.version_ jar rubygems bundler _bundler.version_ gem _jruby.version_ development false UTF-8 ${project.build.directory}/rubygems ${project.build.directory}/rubygems _project.version_ de.saumya.mojo bundler-maven-plugin ${jruby.plugins.version} de.saumya.mojo rails3-maven-plugin ${jruby.plugins.version} in_phase_validate validate initialize maven-war-plugin _war.version_ public . WEB-INF app/** config/** lib/** vendor/** Gemfile ${gem.path} WEB-INF/gems gems/** specifications/** config/web.xml org.eclipse.m2e lifecycle-mapping 1.0.0 de.saumya.mojo bundler-maven-plugin [0,) install assets true development true test true rails.env test production rails.env production ${project.build.directory}/rubygems-production ${project.build.directory}/rubygems-production XML end it 'should load Gemfile from a rails application"' do @project.load_gemfile(File.join(File.dirname(__FILE__), 'Gemfile.rails')) @project.to_xml.should == <<-XML 4.0.0 rails test 0.0.0 war rubygems rails 3.0.1 gem #{ !defined?(JRUBY_VERSION) ? '' : ' rubygems activerecord-jdbc-adapter [0,) gem ' } de.saumya.mojo bundler-maven-plugin development rubygems #{ defined?(JRUBY_VERSION) ? 'jdbc-' : ''}sqlite3 [0,) gem rubygems rspec [0,) gem test rubygems rspec [0,) gem production rubygems #{ defined?(JRUBY_VERSION) ? 'jdbc-' : ''}mysql [0,) gem XML end end