Skip to content

Commit

Permalink
added test for new booty, updated for ruby v1.9.2 and latest rspec
Browse files Browse the repository at this point in the history
  • Loading branch information
bmishkin committed Mar 28, 2011
1 parent bfd3fe3 commit c7d4a20
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 14 deletions.
22 changes: 11 additions & 11 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion features/support/env.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
$LOAD_PATH.unshift(File.dirname(__FILE__) + '/../../lib')
require 'csv_pirate'

require 'spec/expectations'
#require 'spec/expectations'

require 'test/unit/assertions'

Expand Down
23 changes: 23 additions & 0 deletions spec/csv_pirate_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
5 changes: 3 additions & 2 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -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

Expand Down
4 changes: 4 additions & 0 deletions spec/spec_helpers/glowing_gas_ball.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down

0 comments on commit c7d4a20

Please sign in to comment.