Permalink
Browse files

Update to RSpec 2.

  • Loading branch information...
1 parent 2af594d commit 5f33fbadbc1fd9ca9c2af3157476ad3de57cf752 @harukizaemon harukizaemon committed Oct 22, 2010
Showing with 25 additions and 15 deletions.
  1. +1 −0 .rspec
  2. +1 −1 Rakefile
  3. +2 −2 hamster.gemspec
  4. +1 −1 lib/hamster/list.rb
  5. +15 −3 spec/hamster/core_ext/io_spec.rb
  6. +0 −2 spec/spec.opts
  7. +5 −0 tasks/rspec.rb
  8. +0 −6 tasks/spec.rb
View
1 .rspec
@@ -0,0 +1 @@
+--colour
View
2 Rakefile
@@ -2,4 +2,4 @@ Dir[File.expand_path("tasks/**/*.rb")].each do |task_file|
require task_file
end
-task :default => [ :spec ]
+task :default => [ :rspec ]
View
4 hamster.gemspec
@@ -10,10 +10,10 @@ Gem::Specification.new do |s|
s.summary = "Efficient, Immutable, Thread-Safe Collection classes for Ruby"
s.description = s.summary
s.author = "Simon Harris"
- s.email = "haruki.zaemon@gmail.com"
+ s.email = "haruki_zaemon@mac.com"
s.homepage = "http://github.com/harukizaemon/hamster"
s.require_path = "lib"
s.files = Dir["lib/**/*", "spec/**/*", "tasks/**/*", "Rakefile"] + s.extra_rdoc_files
- s.add_development_dependency("rspec", ">= 1.2.9")
+ s.add_development_dependency("rspec", ">= 2.0.0")
s.add_development_dependency("diff-lcs", ">= 1.1.2")
end
View
2 lib/hamster/list.rb
@@ -483,7 +483,7 @@ def respond_to?(name, include_private = false)
private
def method_missing(name, *args, &block)
- return accessor($1) if CADR === name.to_s
+ return accessor($1) if CADR === name
super
end
View
18 spec/hamster/core_ext/io_spec.rb
@@ -6,10 +6,22 @@
describe "#to_list" do
- it "returns an equivalent list" do
- File.open(File.dirname(__FILE__) + "/io_spec.txt") do |io|
- io.to_list.should == Hamster.list("A\n", "B\n", "C\n")
+ context "with a File" do
+
+ it "returns an equivalent list" do
+ File.open(File.dirname(__FILE__) + "/io_spec.txt") do |io|
+ io.to_list.should == Hamster.list("A\n", "B\n", "C\n")
+ end
end
+
+ end
+
+ context "with a StringIO" do
+
+ it "returns an equivalent list" do
+ StringIO.new("A\nB\nC\n").to_list.should == Hamster.list("A\n", "B\n", "C\n")
+ end
+
end
end
View
2 spec/spec.opts
@@ -1,2 +0,0 @@
---colour
---loadby random
View
5 tasks/rspec.rb
@@ -0,0 +1,5 @@
+require 'rspec/core/rake_task'
+
+desc "Run specifications"
+RSpec::Core::RakeTask.new(:rspec) do |t|
+end
View
6 tasks/spec.rb
@@ -1,6 +0,0 @@
-require 'spec/rake/spectask'
-
-desc "Run specifications"
-Spec::Rake::SpecTask.new(:spec) do |t|
- t.spec_opts << "--options" << "spec/spec.opts" if File.exists?("spec/spec.opts")
-end

0 comments on commit 5f33fba

Please sign in to comment.