Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

update to latest rspec

  • Loading branch information...
commit ddbedceb8a991e69156cb372634552b5cc8ea9b9 1 parent 720b173
Justin Smestad jsmestad authored
1  .rspec
View
@@ -0,0 +1 @@
+--colour
6 Gemfile
View
@@ -8,10 +8,8 @@ group :runtime do
end
group :test do
- gem 'rspec', '~> 1.3.0', :require => 'spec'
+ gem 'rspec'
gem 'rake'
gem 'jeweler'
- gem 'stale_fish', '~> 1.3.0'
- gem "ruby-debug", :platforms => :mri_18
- gem "ruby-debug19", :platforms => :mri_19
+ gem 'stale_fish', '~> 1.3.1', :path => '../stale_fish'
end
48 Gemfile.lock
View
@@ -1,12 +1,18 @@
+PATH
+ remote: ../stale_fish
+ specs:
+ stale_fish (1.3.1)
+ activesupport
+ fakeweb
+
GEM
remote: http://rubygems.org/
specs:
activesupport (3.2.1)
i18n (~> 0.6)
multi_json (~> 1.0)
- archive-tar-minitar (0.5.2)
builder (3.0.0)
- columnize (0.3.6)
+ diff-lcs (1.1.3)
fakeweb (1.3.0)
git (1.2.5)
happymapper (0.4.0)
@@ -19,38 +25,22 @@ GEM
rdoc
json (1.6.5)
libxml-ruby (2.2.2)
- linecache (0.46)
- rbx-require-relative (> 0.0.4)
- linecache19 (0.5.12)
- ruby_core_source (>= 0.1.4)
mime-types (1.17.2)
multi_json (1.0.4)
nokogiri (1.5.0)
rake (0.9.2.2)
- rbx-require-relative (0.0.5)
rdoc (3.12)
json (~> 1.4)
rest-client (1.6.7)
mime-types (>= 1.16)
- rspec (1.3.2)
- ruby-debug (0.10.4)
- columnize (>= 0.1)
- ruby-debug-base (~> 0.10.4.0)
- ruby-debug-base (0.10.4)
- linecache (>= 0.3)
- ruby-debug-base19 (0.11.25)
- columnize (>= 0.3.1)
- linecache19 (>= 0.5.11)
- ruby_core_source (>= 0.1.4)
- ruby-debug19 (0.11.6)
- columnize (>= 0.3.1)
- linecache19 (>= 0.5.11)
- ruby-debug-base19 (>= 0.11.19)
- ruby_core_source (0.1.5)
- archive-tar-minitar (>= 0.5.2)
- stale_fish (1.3.0)
- activesupport
- fakeweb
+ rspec (2.8.0)
+ rspec-core (~> 2.8.0)
+ rspec-expectations (~> 2.8.0)
+ rspec-mocks (~> 2.8.0)
+ rspec-core (2.8.0)
+ rspec-expectations (2.8.0)
+ diff-lcs (~> 1.1.2)
+ rspec-mocks (2.8.0)
PLATFORMS
ruby
@@ -62,7 +52,5 @@ DEPENDENCIES
nokogiri (~> 1.4)
rake
rest-client (~> 1.6.0)
- rspec (~> 1.3.0)
- ruby-debug
- ruby-debug19
- stale_fish (~> 1.3.0)
+ rspec
+ stale_fish (~> 1.3.1)!
21 Rakefile
View
@@ -1,4 +1,9 @@
-require 'rake'
+#!/usr/bin/env rake
+begin
+ require 'bundler/setup'
+rescue LoadError
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
+end
begin
require 'jeweler'
@@ -24,17 +29,9 @@ rescue LoadError
puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
end
-require 'spec/rake/spectask'
-Spec::Rake::SpecTask.new(:spec) do |spec|
- spec.libs << 'lib' << 'spec'
- spec.spec_files = FileList['spec/**/*_spec.rb']
-end
-
-Spec::Rake::SpecTask.new(:rcov) do |spec|
- spec.libs << 'lib' << 'spec'
- spec.pattern = 'spec/**/*_spec.rb'
- spec.rcov = true
-end
+require 'rspec/core'
+require 'rspec/core/rake_task'
+RSpec::Core::RakeTask.new(:spec)
task :default => :spec
8 spec/spec_helper.rb
View
@@ -1,14 +1,12 @@
-require 'rubygems'
require 'bundler'
-require 'stale_fish'
Bundler.require(:default, :runtime, :test)
$LOAD_PATH.unshift(File.dirname(__FILE__))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'pivotal-tracker'
-require 'spec'
-require 'spec/autorun'
+require 'rspec'
+require 'rspec/autorun'
PROJECT_ID = ENV['PROJECT_ID'] || "102622"
TOKEN = '8358666c5a593a3c82cda728c8a62b63'
@@ -30,7 +28,7 @@ def is_stale?
StaleFish.setup(File.join(File.dirname(__FILE__), 'fixtures', 'stale_fish.yml'))
-Spec::Runner.configure do |config|
+RSpec.configure do |config|
# config.include(Rack::Test::Methods)
config.before :suite do
41 spec/unit/pivotal-tracker/client_spec.rb
View
@@ -1,5 +1,4 @@
require "spec_helper"
-require 'ruby-debug'
describe PivotalTracker::Client do
@@ -44,42 +43,15 @@
context "with an existing token" do
before do
- PivotalTracker::Client.clear_connections
PivotalTracker::Client.token = "abc123"
end
- it "should fetch a new token when logging in" do
- NEW_TOKEN = "new_token"
-
- response_body = Nokogiri::XML::Builder.new do |root|
- root.guid NEW_TOKEN
- end
-
- FakeWeb.register_uri :post,
- 'https://www.pivotaltracker.com/services/v3/tokens/active',
- body: response_body.to_xml
-
- PivotalTracker::Client.token("user", "password").should == NEW_TOKEN
- end
-
- it "should use different connection for new token" do
- connection1 = PivotalTracker::Client.connection
- connection1.should_not be_nil
-
- PivotalTracker::Client.token = "other_token"
- connection2 = PivotalTracker::Client.connection
- connection2.should_not be_nil
-
- connection2.should_not == connection1
- end
-
-
it "returned a RestClient::Resource using the token" do
@resource = Object.new
RestClient::Resource.should_receive(:new).
- with("http://www.pivotaltracker.com/services/v3", :headers => {'X-TrackerToken' => "abc123", 'Content-Type' => 'application/xml'}).
- and_return(@resource)
+ with("http://www.pivotaltracker.com/services/v3", :headers => {'X-TrackerToken' => "abc123", 'Content-Type' => 'application/xml'}).
+ and_return(@resource)
PivotalTracker::Client.connection.should == @resource
end
@@ -99,12 +71,9 @@
it "returned the connection for the new token" do
@resource = Object.new
- url = "http://www.pivotaltracker.com/services/v3"
- @resource.stub(:url, url)
-
RestClient::Resource.should_receive(:new).
- with(url, :headers => {'X-TrackerToken' => "anewtoken", 'Content-Type' => 'application/xml'}).
- and_return(@resource)
+ with("http://www.pivotaltracker.com/services/v3", :headers => {'X-TrackerToken' => "anewtoken", 'Content-Type' => 'application/xml'}).
+ and_return(@resource)
PivotalTracker::Client.connection.should == @resource
end
@@ -114,4 +83,4 @@
end
end
-end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.