Skip to content
Browse files

Spec fixes for ruby 1.9/rspec 2.x

  • Loading branch information...
1 parent 42d35d4 commit 91426706535a7c1a30dac3278d13c5aff83239f8 @namelessjon committed Jul 23, 2011
View
2 spec/core_ext/hash_spec.rb
@@ -9,7 +9,7 @@
:one => 1,
:two => 2,
3 => 'three',
- [3,4] => :thirty_four
+ 34 => :thirty_four
}.stringify_keys
h.keys.sort.should == %w[3 34 one two]
end
View
2 spec/core_ext/time_spec.rb
@@ -8,7 +8,7 @@
now = Time.now
utc_offset = now.utc_offset / 3600
- sign, utc_offset = utc_offset < 0 ? ['-', -utc_offset] : ['', utc_offset]
+ sign, utc_offset = utc_offset < 0 ? ['-', -utc_offset] : ['+', utc_offset]
str = "%s.%06d %s%02d:00" %
[now.strftime('%Y-%m-%d %H:%M:%S'), now.usec, sign, utc_offset]
View
4 spec/spec_helper.rb
@@ -12,14 +12,14 @@
end
require 'fileutils'
-require 'spec'
+require 'rspec'
require 'spec/logging_helper'
dir = File.expand_path(File.dirname(__FILE__))
require File.join(dir, %w[.. lib webby])
Dir.glob(File.join(dir, %w[helpers *_helper.rb])).each {|fn| require fn}
-Spec::Runner.configure do |config|
+RSpec.configure do |config|
include Spec::LoggingHelper
include WebbyHelper
View
2 spec/webby/apps/generator_spec.rb
@@ -77,7 +77,7 @@
h["layouts"].should == %w[layouts/default.txt]
h["tasks"].should == %w[tasks/blog.rake]
h["templates"].should == %w[templates/atom_feed.erb]
- h["templates/blog"].should == [
+ h["templates/blog"].should =~ [
"templates/blog/year.erb",
"templates/blog/post.erb",
"templates/blog/month.erb"
View
4 spec/webby/resources/db_spec.rb
@@ -203,7 +203,7 @@
it 'can search is a specific directory' do
pages = @db.find('all', :in_directory => 'tumblog')
pages.map! {|p| p.path}
- pages.should == %w[
+ pages.should =~ %w[
content/tumblog/index.txt
content/tumblog/rss.txt
]
@@ -212,7 +212,7 @@
it 'can recurse into directories' do
pages = @db.find('all', :in_directory => 'tumblog/200807', :recursive => true)
pages.map! {|p| p.title}
- pages.should == [
+ pages.should =~ [
'The Wisdom of the Dutch',
'Mad City Chickens',
'Historical Perspectives on the Classic Chicken Joke',

0 comments on commit 9142670

Please sign in to comment.
Something went wrong with that request. Please try again.