Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

rspec it up, comment out neighboring mirah_model

-add rspec and mocha as dev deps
-add spec task as default
-add quiet to generator, and use it for specs
-fix servlet api jar location

you should be able to

git clone
bundle install
rake

and have it work now
  • Loading branch information...
commit 9ef8f082ea126b2d043faf05674e78b8f2c97ac8 1 parent 522fc22
@baroquebobcat baroquebobcat authored
View
2  Gemfile
@@ -3,6 +3,6 @@ source :gemcutter
gemspec
#gem 'mirah', '0.0.6', :path => '../mirah'#, :git => 'git://github.com/mirah/mirah.git'
-gem 'mirah_model', "0.0.2", :path => '../mirah_model'
+#gem 'mirah_model', "0.0.2", :path => '../mirah_model'
gem 'rake'
View
6 Rakefile
@@ -2,6 +2,8 @@ require 'rubygems'
require 'rubygems/package_task'
require 'rake/clean'
require 'bundler/setup'
+require 'rspec/core/rake_task'
+
Bundler.setup
begin
@@ -16,6 +18,10 @@ Gem::PackageTask.new Gem::Specification.load('dubious.gemspec') do |pkg|
pkg.need_tar = true
end
+Rspec::Core::RakeTask.new
+
+task :default => :spec
+
require 'dubious_tasks'
OUTDIR = File.expand_path 'build'
View
3  dubious.gemspec
@@ -28,4 +28,7 @@ Gem::Specification.new do |s|
s.add_dependency("mirah", "0.0.5")
s.add_dependency("mirah_model", "0.0.2")
s.add_dependency("appengine-sdk", "~> 1.4.0")
+
+ s.add_development_dependency("rspec","2.4.0")
+ s.add_development_dependency("mocha","0.9.12")
end
View
4 lib/dubious/cli/generator.rb
@@ -4,9 +4,9 @@ class Generator < Thor
include Thor::Actions
source_root File.dirname(__FILE__)+"/../templates/generator"
argument :name
+ add_runtime_options!
-
- desc "model NAME", "creates model file"
+ desc "model NAME", "creates model file"
def model#(name)
template "model.mirah.tt", "app/models/#{name.underscore}.mirah"
end
View
11 spec/dubious_cli_spec.rb
@@ -1,9 +1,12 @@
require File.dirname(__FILE__)+'/../lib/dubious/cli'
+
describe Dubious::CLI do
+
before :each do
FileUtils.rm_rf 'spec/temp'
Dir.mkdir 'spec/temp'
end
+
describe "subcommands" do
subject { Dubious::CLI::Main.subcommands }
it { should include 'new' }
@@ -11,15 +14,21 @@
end
describe Dubious::CLI::Generator do
+
it 'expects a name' do
lambda {
Dubious::CLI::Generator.new
}.should raise_error
end
+
describe "#model" do
it '...' do
- Dubious::CLI::Generator.new(['something']).tap{|g|g.destination_root=File.dirname(__FILE__)+'/temp'}.model
+ generator = Dubious::CLI::Generator.new(['something'],:quiet=>true)
+ generator.destination_root=File.dirname(__FILE__)+'/temp'
+ generator.model
end
end
+
+
end
end
View
7 spec/spec_helper.rb
@@ -1,9 +1,12 @@
require 'java'
+require 'bundler/setup'
require 'mirah'
require 'appengine-sdk'
-require 'rspec'
+require 'rspec/core'
+require 'mocha'
-require AppEngine::SDK::SDK_ROOT + '/lib/shared/geronimo-servlet_2.5_spec-1.2.jar'
+
+require AppEngine::SDK::SDK_ROOT + '/lib/shared/servlet-api.jar'
require File.dirname(__FILE__)+'/../lib/dubious.jar'
require File.dirname(__FILE__)+'/../javalib/mirahdatastore.jar'
Please sign in to comment.
Something went wrong with that request. Please try again.