Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Set up bundler

  • Loading branch information...
commit 9d7d27ed1d3eecf2ab2a8d6b2bdb2ab7a5af94fb 1 parent 5ba6081
@glv authored
View
2  .gitignore
@@ -4,3 +4,5 @@ coverage
rdoc
pkg
rspec-dev-setup.rb
+.rvmrc
+.bundle
View
14 Gemfile
@@ -0,0 +1,14 @@
+source :gemcutter
+
+# path File.expand_path('../vendor/gems', __FILE__)
+
+gem 'rspec', '>= 2.0.0.beta.3'
+
+group :test do
+ gem 'rake', '>= 0.8.7'
+end
+
+group :release do
+ gem 'jeweler', '>= 1.4.0'
+end
+
View
39 Gemfile.lock
@@ -0,0 +1,39 @@
+---
+dependencies:
+ rake:
+ group:
+ - :test
+ version: ">= 0.8.7"
+ rspec:
+ group:
+ - :default
+ version: ">= 2.0.0.beta.3"
+ jeweler:
+ group:
+ - :release
+ version: ">= 1.4.0"
+specs:
+- rake:
+ version: 0.8.7
+- rspec-core:
+ version: 2.0.0.beta.3
+- rspec:
+ version: 2.0.0.beta.3
+- rubyforge:
+ version: 2.0.4
+- rspec-expectations:
+ version: 2.0.0.beta.3
+- gemcutter:
+ version: 0.5.0
+- jeweler:
+ version: 1.4.0
+- git:
+ version: 1.2.5
+- json_pure:
+ version: 1.2.3
+- rspec-mocks:
+ version: 2.0.0.beta.3
+hash: 52c8426bd6633bf8e04b51a60c771b9cdce632ef
+sources:
+- Rubygems:
+ uri: http://gemcutter.org
View
25 Rakefile
@@ -1,7 +1,19 @@
-require 'rubygems'
-require 'rake'
+def rcr?
+ ENV['RUN_CODE_RUN'] == 'true'
+end
+
+system("bundle install --disable-shared-gems") if rcr?
-require File.dirname(__FILE__) + '/rspec-dev-setup' if File.exists?(File.dirname(__FILE__) + '/rspec-dev-setup.rb')
+begin
+ # Try to require the preresolved locked set of gems.
+ require File.expand_path('../.bundle/environment', __FILE__)
+rescue LoadError
+ # Fall back on doing an unlocked resolve at runtime.
+ puts "Something's wrong with bundle configuration. Falling back to RubyGems."
+ require "rubygems"
+ require "bundler"
+ Bundler.setup
+end
begin
require 'jeweler'
@@ -40,12 +52,7 @@ task :default => :examples
require 'rake/rdoctask'
Rake::RDocTask.new do |rdoc|
- if File.exist?('VERSION.yml')
- config = YAML.load(File.read('VERSION.yml'))
- version = "#{config[:major]}.#{config[:minor]}.#{config[:patch]}"
- else
- version = ""
- end
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
rdoc.rdoc_dir = 'rdoc'
rdoc.title = "rspec-unit #{version}"
View
4 lib/rspec/unit/test_case.rb
@@ -65,7 +65,7 @@ def self.to_s
end
def self.test_case_name(klass)
- class_name = klass.name(false)
+ class_name = klass.name
(class_name.nil? || class_name.empty?) ? 'Anonymous TestCase' : "TestCase #{class_name}"
end
@@ -104,7 +104,7 @@ def self.number_of_tests
def self.tests
@tests ||= test_methods.sort.map do |m|
- name = "#{metadata[:example_group][:name]}##{m}"
+ name = "#{display_name}##{m}"
meta = (test_method_metadata[m] || {}).merge({:caller => caller_lines[m],
:full_description => name,
:test_unit => true})
View
14 spec/spec_helper.rb
@@ -1,9 +1,15 @@
-require 'rubygems'
-
-require File.dirname(__FILE__) + '/../rspec-dev-setup' if File.exists?(File.dirname(__FILE__) + '/../rspec-dev-setup.rb')
+begin
+ # Try to require the preresolved locked set of gems.
+ require File.expand_path('../../.bundle/environment', __FILE__)
+rescue LoadError
+ # Fall back on doing an unlocked resolve at runtime.
+ puts "Something's wrong with bundle configuration. Falling back to RubyGems."
+ require "rubygems"
+ require "bundler"
+ Bundler.setup
+end
require 'rspec'
-gem 'mocha'
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
View
14 spec/test_case_spec.rb
@@ -192,17 +192,17 @@ class SampleTestCaseForName < Rspec::Unit::TestCase
end
end
- it "sets :name to 'TestCase' and the class name if the class has one" do
- SampleTestCaseForName.metadata[:example_group][:name].should == "TestCase SampleTestCaseForName"
+ it "sets :description to 'TestCase' and the class name if the class has one" do
+ SampleTestCaseForName.metadata[:example_group][:description].should == "TestCase SampleTestCaseForName"
end
- it "sets :name to 'Anonymous TestCase' for anonymous test classes" do
- @foo.metadata[:example_group][:name].should == "Anonymous TestCase"
+ it "sets :description to 'Anonymous TestCase' for anonymous test classes" do
+ @foo.metadata[:example_group][:description].should == "Anonymous TestCase"
end
- it "sets :description to be the same as :name" do
- @foo.metadata[:example_group][:description].should == @foo.metadata[:example_group][:name]
- SampleTestCaseForName.metadata[:example_group][:description].should == SampleTestCaseForName.metadata[:example_group][:name]
+ it "sets :full_description to be the same as :description" do
+ @foo.metadata[:example_group][:full_description].should == @foo.metadata[:example_group][:description]
+ SampleTestCaseForName.metadata[:example_group][:full_description].should == SampleTestCaseForName.metadata[:example_group][:description]
end
it "adds :test_unit => true" do
View
BIN  vendor/cache/gemcutter-0.5.0.gem
Binary file not shown
View
BIN  vendor/cache/git-1.2.5.gem
Binary file not shown
View
BIN  vendor/cache/jeweler-1.4.0.gem
Binary file not shown
View
BIN  vendor/cache/json_pure-1.2.3.gem
Binary file not shown
View
BIN  vendor/cache/rspec-2.0.0.beta.3.gem
Binary file not shown
View
BIN  vendor/cache/rspec-core-2.0.0.beta.3.gem
Binary file not shown
View
BIN  vendor/cache/rspec-expectations-2.0.0.beta.3.gem
Binary file not shown
View
BIN  vendor/cache/rspec-mocks-2.0.0.beta.3.gem
Binary file not shown
View
BIN  vendor/cache/rubyforge-2.0.4.gem
Binary file not shown
Please sign in to comment.
Something went wrong with that request. Please try again.