Permalink
Browse files

Use bundler. Upgrade rspec & jeweler.

This is to get things passing on TravisCI.
  • Loading branch information...
1 parent 217cdc2 commit fa9148dc9187a90e74ac913c264d0489fec7138a @duelinmarkers committed Oct 26, 2012
Showing with 51 additions and 31 deletions.
  1. +5 −0 Gemfile
  2. +30 −0 Gemfile.lock
  3. +11 −16 Rakefile
  4. +4 −4 spec/renum_spec.rb
  5. +1 −11 spec/spec_helper.rb
View
@@ -0,0 +1,5 @@
+source 'https://rubygems.org'
+
+gem 'rake', :group => [:development, :test]
+gem 'rspec', :group => [:development, :test]
+gem 'jeweler', :group => [:development, :test]
View
@@ -0,0 +1,30 @@
+GEM
+ remote: https://rubygems.org/
+ specs:
+ diff-lcs (1.1.3)
+ git (1.2.5)
+ jeweler (1.8.4)
+ bundler (~> 1.0)
+ git (>= 1.2.5)
+ rake
+ rdoc
+ json (1.7.5)
+ rake (0.9.2.2)
+ rdoc (3.12)
+ json (~> 1.4)
+ rspec (2.11.0)
+ rspec-core (~> 2.11.0)
+ rspec-expectations (~> 2.11.0)
+ rspec-mocks (~> 2.11.0)
+ rspec-core (2.11.1)
+ rspec-expectations (2.11.3)
+ diff-lcs (~> 1.1.3)
+ rspec-mocks (2.11.3)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ jeweler
+ rake
+ rspec
View
@@ -1,22 +1,17 @@
require 'rubygems'
-require 'spec/rake/spectask'
+require 'rspec/core/rake_task'
-Spec::Rake::SpecTask.new do |t|
-end
+RSpec::Core::RakeTask.new
task :default => :spec
-begin
- require 'jeweler'
- Jeweler::Tasks.new do |s|
- s.name = "renum"
- s.summary = "provides a readable but terse enum facility for Ruby"
- s.email = "duelin.markers@gmail.com"
- s.homepage = "http://github.com/duelinmarkers/renum"
- s.description = "provides a readable but terse enum facility for Ruby"
- s.authors = ["John Hume"]
- end
- Jeweler::GemcutterTasks.new
-rescue LoadError
- puts "Jeweler or a dependency not available. To install: sudo gem install jeweler"
+require 'jeweler'
+Jeweler::Tasks.new do |s|
+ s.name = "renum"
+ s.summary = "provides a readable but terse enum facility for Ruby"
+ s.email = "duelin.markers@gmail.com"
+ s.homepage = "http://github.com/duelinmarkers/renum"
+ s.description = "provides a readable but terse enum facility for Ruby"
+ s.authors = ["John Hume"]
end
+Jeweler::RubygemsDotOrgTasks.new
View
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
+require 'spec_helper'
enum :Status, [ :NOT_STARTED, :IN_PROGRESS, :COMPLETE ]
@@ -158,14 +158,14 @@ def description
describe "prevention of subtle and annoying bugs" do
it "prevents you modifying the values array" do
- lambda { Color.values << 'some crazy value' }.should raise_error(TypeError, /can't modify frozen/)
+ expect { Color.values << 'some crazy value' }.to raise_error(/can't modify frozen/)
end
it "prevents you modifying the name hash" do
- lambda { Color.values_by_name['MAGENTA'] = 'some crazy value' }.should raise_error(TypeError, /can't modify frozen/)
+ expect { Color.values_by_name['MAGENTA'] = 'some crazy value' }.to raise_error(/can't modify frozen/)
end
it "prevents you modifying the name of a value" do
- lambda { Color::RED.name << 'dish-Brown' }.should raise_error(TypeError, /can't modify frozen/)
+ expect { Color::RED.name << 'dish-Brown' }.to raise_error(/can't modify frozen/)
end
end
View
@@ -1,12 +1,2 @@
-begin
- require 'spec'
-rescue LoadError
- require 'rubygems'
- gem 'rspec'
- require 'spec'
-end
-
-if ENV['USE_GEM']
- require 'rubygems'
-end
+require 'rspec'
require 'renum'

0 comments on commit fa9148d

Please sign in to comment.