Permalink
Browse files

Make sad specs running again after maven conversion

  • Loading branch information...
1 parent 0906da3 commit 8013767dbcbf8d3c3ae7a260aee3ac2cdec16ce0 @enebo committed Mar 2, 2013
Showing with 29 additions and 2 deletions.
  1. +12 −0 Rakefile
  2. +15 −0 spec/block_spec.rb
  3. +2 −2 spec/fixtures/block_helper.rb
View
@@ -0,0 +1,12 @@
+require 'rspec/core/rake_task'
+
+# FIXME: This sucks. We should be single-sourcing this from here or maven.
+# Right now this version number is in one Java source file, Maven pom,
+# and here.
+BUKKIT_VERSION = '1.4.7-R1.0'
+
+RSpec::Core::RakeTask.new(:spec) do |t|
+ t.ruby_opts = "-I#{File.join(File.dirname(__FILE__),'src','main','resources')} -r~/.m2/repository/org/bukkit/bukkit/#{BUKKIT_VERSION}/bukkit-#{BUKKIT_VERSION}.jar"
+end
+
+task :default => :spec
View
@@ -0,0 +1,15 @@
+require 'java'
+require 'fixtures/block_helper'
+
+describe org::bukkit::block::Block do
+ before do
+ @bed = SpecBlock.new org.bukkit.material.Bed.new
+ end
+
+ it "is? can tell a bed from a bunch o dirt" do
+ @bed.is?(:bed_block).should == true
+ @bed.is?(:grass).should == false
+ @bed.is?(:grass, :bed_block).should == true
+ @bed.is?(:grass, :dirt).should == false
+ end
+end
@@ -1,6 +1,6 @@
require 'java'
-require File.join(File.dirname(__FILE__),'..','..','dist','Purugin.jar')
-require 'bukkit/block'
+require Dir[File.join(File.dirname(__FILE__),'..','..','target','*.jar')][0]
+require 'purugin'
require 'bukkit/material'
# This represents a live version of a block. Note that we cannot use

0 comments on commit 8013767

Please sign in to comment.