Browse files

added test for new booty, updated for ruby v1.9.2 and latest rspec

  • Loading branch information...
1 parent bfd3fe3 commit c7d4a20ee868e852fe8e890016dddaf9b980d51f @bmishkin bmishkin committed Mar 28, 2011
Showing with 42 additions and 14 deletions.
  1. +11 −11 Rakefile
  2. +1 −1 features/support/env.rb
  3. +23 −0 spec/csv_pirate_spec.rb
  4. +3 −2 spec/spec_helper.rb
  5. +4 −0 spec/spec_helpers/glowing_gas_ball.rb
View
22 Rakefile
@@ -43,17 +43,17 @@ Rake::RDocTask.new do |rdoc|
rdoc.rdoc_files.include('lib/**/*.rb')
end
-require 'spec/rake/spectask'
-Spec::Rake::SpecTask.new(:spec) do |t|
- t.libs << 'lib' << 'spec'
- t.spec_files = FileList['spec/**/*_spec.rb']
-end
-
-Spec::Rake::SpecTask.new(:rcov) do |t|
- t.libs << 'lib' << 'spec'
- t.spec_files = FileList['spec/**/*_spec.rb']
- t.rcov = true
-end
+# require 'spec/rake/spectask'
+# Spec::Rake::SpecTask.new(:spec) do |t|
+# t.libs << 'lib' << 'spec'
+# t.spec_files = FileList['spec/**/*_spec.rb']
+# end
+#
+# Spec::Rake::SpecTask.new(:rcov) do |t|
+# t.libs << 'lib' << 'spec'
+# t.spec_files = FileList['spec/**/*_spec.rb']
+# t.rcov = true
+# end
begin
require 'cucumber/rake/task'
View
2 features/support/env.rb
@@ -1,7 +1,7 @@
$LOAD_PATH.unshift(File.dirname(__FILE__) + '/../../lib')
require 'csv_pirate'
-require 'spec/expectations'
+#require 'spec/expectations'
require 'test/unit/assertions'
View
23 spec/csv_pirate_spec.rb
@@ -52,6 +52,29 @@
end
end
+
+ describe "#create with function-arg booty" do
+ before(:each) do
+ @csv_pirate = CsvPirate.create({
+ :grub => GlowingGasBall,
+ :spyglasses => [:get_stars],
+ :chart => ["spec","csv","GlowingGasBall"],
+ :booty => [[:sub_name, 'a', 'Z'], :distance, :spectral_type, {:name => :hash}, {:name => :next}, {:name => :upcase}, :star_vowels ],
+ :chronometer => false,
+ :gibbet => "",
+ :aft => ".csv",
+ :swab => :none,
+ :mop => :clean,
+ :waggoner => 'data'
+ })
+ end
+
+ it "should call instance functions with arguments an instance of CsvPirate" do
+ @csv_pirate.maroon.should =~ /ProximZ CentZuri/
+ end
+ end
+
+
describe "#hoist_mainstay" do
before(:each) do
@csv_pirate = CsvPirate.new({
View
5 spec/spec_helper.rb
@@ -1,10 +1,11 @@
-require 'spec'
+#require 'spec'
+require 'rspec/core'
$LOAD_PATH.unshift(File.dirname(__FILE__))
require File.dirname(__FILE__) + '/../init'
-Spec::Runner.configure do |config|
+RSpec.configure do |config|
end
View
4 spec/spec_helpers/glowing_gas_ball.rb
@@ -12,6 +12,10 @@ def star_vowels
self.name.tr('aeiou', '*')
end
+ def sub_name(old_letter, new_letter)
+ name.gsub(old_letter, new_letter)
+ end
+
def self.get_stars
[
GlowingGasBall.new(:name => "Proxima Centauri", :distance => "4.2 LY", :spectral_type => "M5.5Vc"),

0 comments on commit c7d4a20

Please sign in to comment.