pivotal-tracker 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --colour
data/Gemfile CHANGED
@@ -8,10 +8,8 @@ group :runtime do
8
8
  end
9
9
 
10
10
  group :test do
11
- gem 'rspec', '~> 1.3.0', :require => 'spec'
11
+ gem 'rspec'
12
12
  gem 'rake'
13
13
  gem 'jeweler'
14
- gem 'stale_fish', '~> 1.3.0'
15
- gem "ruby-debug", :platforms => :mri_18
16
- gem "ruby-debug19", :platforms => :mri_19
14
+ gem 'stale_fish', '~> 1.3.1', :path => '../stale_fish'
17
15
  end
data/Gemfile.lock CHANGED
@@ -1,12 +1,18 @@
1
+ PATH
2
+ remote: ../stale_fish
3
+ specs:
4
+ stale_fish (1.3.1)
5
+ activesupport
6
+ fakeweb
7
+
1
8
  GEM
2
9
  remote: http://rubygems.org/
3
10
  specs:
4
11
  activesupport (3.2.1)
5
12
  i18n (~> 0.6)
6
13
  multi_json (~> 1.0)
7
- archive-tar-minitar (0.5.2)
8
14
  builder (3.0.0)
9
- columnize (0.3.6)
15
+ diff-lcs (1.1.3)
10
16
  fakeweb (1.3.0)
11
17
  git (1.2.5)
12
18
  happymapper (0.4.0)
@@ -19,38 +25,22 @@ GEM
19
25
  rdoc
20
26
  json (1.6.5)
21
27
  libxml-ruby (2.2.2)
22
- linecache (0.46)
23
- rbx-require-relative (> 0.0.4)
24
- linecache19 (0.5.12)
25
- ruby_core_source (>= 0.1.4)
26
28
  mime-types (1.17.2)
27
29
  multi_json (1.0.4)
28
30
  nokogiri (1.5.0)
29
31
  rake (0.9.2.2)
30
- rbx-require-relative (0.0.5)
31
32
  rdoc (3.12)
32
33
  json (~> 1.4)
33
34
  rest-client (1.6.7)
34
35
  mime-types (>= 1.16)
35
- rspec (1.3.2)
36
- ruby-debug (0.10.4)
37
- columnize (>= 0.1)
38
- ruby-debug-base (~> 0.10.4.0)
39
- ruby-debug-base (0.10.4)
40
- linecache (>= 0.3)
41
- ruby-debug-base19 (0.11.25)
42
- columnize (>= 0.3.1)
43
- linecache19 (>= 0.5.11)
44
- ruby_core_source (>= 0.1.4)
45
- ruby-debug19 (0.11.6)
46
- columnize (>= 0.3.1)
47
- linecache19 (>= 0.5.11)
48
- ruby-debug-base19 (>= 0.11.19)
49
- ruby_core_source (0.1.5)
50
- archive-tar-minitar (>= 0.5.2)
51
- stale_fish (1.3.0)
52
- activesupport
53
- fakeweb
36
+ rspec (2.8.0)
37
+ rspec-core (~> 2.8.0)
38
+ rspec-expectations (~> 2.8.0)
39
+ rspec-mocks (~> 2.8.0)
40
+ rspec-core (2.8.0)
41
+ rspec-expectations (2.8.0)
42
+ diff-lcs (~> 1.1.2)
43
+ rspec-mocks (2.8.0)
54
44
 
55
45
  PLATFORMS
56
46
  ruby
@@ -62,7 +52,5 @@ DEPENDENCIES
62
52
  nokogiri (~> 1.4)
63
53
  rake
64
54
  rest-client (~> 1.6.0)
65
- rspec (~> 1.3.0)
66
- ruby-debug
67
- ruby-debug19
68
- stale_fish (~> 1.3.0)
55
+ rspec
56
+ stale_fish (~> 1.3.1)!
data/Rakefile CHANGED
@@ -1,4 +1,9 @@
1
- require 'rake'
1
+ #!/usr/bin/env rake
2
+ begin
3
+ require 'bundler/setup'
4
+ rescue LoadError
5
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
6
+ end
2
7
 
3
8
  begin
4
9
  require 'jeweler'
@@ -24,17 +29,9 @@ rescue LoadError
24
29
  puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
25
30
  end
26
31
 
27
- require 'spec/rake/spectask'
28
- Spec::Rake::SpecTask.new(:spec) do |spec|
29
- spec.libs << 'lib' << 'spec'
30
- spec.spec_files = FileList['spec/**/*_spec.rb']
31
- end
32
-
33
- Spec::Rake::SpecTask.new(:rcov) do |spec|
34
- spec.libs << 'lib' << 'spec'
35
- spec.pattern = 'spec/**/*_spec.rb'
36
- spec.rcov = true
37
- end
32
+ require 'rspec/core'
33
+ require 'rspec/core/rake_task'
34
+ RSpec::Core::RakeTask.new(:spec)
38
35
 
39
36
  task :default => :spec
40
37
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.0
1
+ 0.5.1
@@ -11,7 +11,6 @@ module PivotalTracker
11
11
  end
12
12
 
13
13
  def token(username, password, method='post')
14
- return @token if @token
15
14
  response = if method == 'post'
16
15
  RestClient.post 'https://www.pivotaltracker.com/services/v3/tokens/active', :username => username, :password => password
17
16
  else
@@ -29,6 +28,10 @@ module PivotalTracker
29
28
  cached_connection? && !protocol_changed? ? cached_connection : new_connection
30
29
  end
31
30
 
31
+ def clear_connections
32
+ @connections = nil
33
+ end
34
+
32
35
  protected
33
36
 
34
37
  def protocol
@@ -31,7 +31,7 @@ module PivotalTracker
31
31
  end
32
32
  end
33
33
 
34
- def create(args)
34
+ def create(args = {})
35
35
  object = @target.new(args.merge({:owner => @owner}))
36
36
  if obj = object.create
37
37
  return obj
@@ -5,17 +5,18 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "pivotal-tracker"
8
- s.version = "0.5.0"
8
+ s.version = "0.5.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Justin Smestad", "Josh Nichols", "Terence Lee"]
12
- s.date = "2012-02-15"
12
+ s.date = "2012-02-17"
13
13
  s.email = "justin.smestad@gmail.com"
14
14
  s.extra_rdoc_files = [
15
15
  "LICENSE",
16
16
  "README.rdoc"
17
17
  ]
18
18
  s.files = [
19
+ ".rspec",
19
20
  "Gemfile",
20
21
  "Gemfile.lock",
21
22
  "LICENSE",
@@ -51,6 +52,10 @@ Gem::Specification.new do |s|
51
52
  "spec/fixtures/projects.xml",
52
53
  "spec/fixtures/stale_fish.yml",
53
54
  "spec/fixtures/stories.xml",
55
+ "spec/fixtures/story-4459994.xml",
56
+ "spec/fixtures/story-4460038.xml",
57
+ "spec/fixtures/story-4460598.xml",
58
+ "spec/fixtures/story-4473735.xml",
54
59
  "spec/fixtures/tasks.xml",
55
60
  "spec/spec.opts",
56
61
  "spec/spec_helper.rb",
@@ -42,6 +42,34 @@
42
42
  request_type: GET
43
43
  update_method: StaleFishFixtures.update_activity_fixture
44
44
  last_updated_at: 2010-07-29T20:15:11+01:00
45
+ - story-4460038:
46
+ file: 'story-4460038.xml'
47
+ update_interval: 2.weeks
48
+ check_against: http://www.pivotaltracker.com/services/v3/projects/102622/stories/4460038
49
+ request_type: GET
50
+ update_method: StaleFishFixtures.update_story_fixture
51
+ last_updated_at: 2010-07-30T03:15:11+08:00
52
+ - story-4459994:
53
+ file: 'story-4459994.xml'
54
+ update_interval: 2.weeks
55
+ check_against: http://www.pivotaltracker.com/services/v3/projects/102622/stories/4459994
56
+ request_type: GET
57
+ update_method: StaleFishFixtures.update_story_fixture
58
+ last_updated_at: 2010-07-30T03:15:11+08:00
59
+ - story-4460598:
60
+ file: 'story-4460598.xml'
61
+ update_interval: 2.weeks
62
+ check_against: http://www.pivotaltracker.com/services/v3/projects/102622/stories/4460598
63
+ request_type: GET
64
+ update_method: StaleFishFixtures.update_story_fixture
65
+ last_updated_at: 2010-07-30T03:15:11+08:00
66
+ - story-4473735:
67
+ file: 'story-4473735.xml'
68
+ update_interval: 2.weeks
69
+ check_against: http://www.pivotaltracker.com/services/v3/projects/102622/stories/4473735
70
+ request_type: GET
71
+ update_method: StaleFishFixtures.update_story_fixture
72
+ last_updated_at: 2010-07-30T03:15:11+08:00
45
73
  - stories:
46
74
  file: 'stories.xml'
47
75
  update_interval: 2.weeks
@@ -0,0 +1,37 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <story>
3
+ <id type="integer">4459994</id>
4
+ <project_id type="integer">102622</project_id>
5
+ <story_type>feature</story_type>
6
+ <url>http://www.pivotaltracker.com/story/show/4459994</url>
7
+ <estimate type="integer">2</estimate>
8
+ <current_state>unstarted</current_state>
9
+ <description>Generic description</description>
10
+ <name>Tasks Test</name>
11
+ <requested_by>Jon Mischo</requested_by>
12
+ <created_at type="datetime">2010/07/27 21:51:01 UTC</created_at>
13
+ <updated_at type="datetime">2010/07/27 22:20:46 UTC</updated_at>
14
+ <tasks type="array">
15
+ <task>
16
+ <id type="integer">468113</id>
17
+ <description>Task number 1</description>
18
+ <position>1</position>
19
+ <complete>false</complete>
20
+ <created_at type="datetime">2010/07/27 21:51:28 UTC</created_at>
21
+ </task>
22
+ <task>
23
+ <id type="integer">468114</id>
24
+ <description>Number 2 Task</description>
25
+ <position>2</position>
26
+ <complete>false</complete>
27
+ <created_at type="datetime">2010/07/27 21:51:32 UTC</created_at>
28
+ </task>
29
+ <task>
30
+ <id type="integer">468117</id>
31
+ <description>3rd task is a charm</description>
32
+ <position>3</position>
33
+ <complete>true</complete>
34
+ <created_at type="datetime">2010/07/27 21:51:42 UTC</created_at>
35
+ </task>
36
+ </tasks>
37
+ </story>
@@ -0,0 +1,46 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <story>
3
+ <id type="integer">4460038</id>
4
+ <project_id type="integer">102622</project_id>
5
+ <story_type>feature</story_type>
6
+ <url>http://www.pivotaltracker.com/story/show/4460038</url>
7
+ <estimate type="integer">1</estimate>
8
+ <current_state>unstarted</current_state>
9
+ <description>This is a story that has comments.</description>
10
+ <name>This is for comments</name>
11
+ <requested_by>Jon Mischo</requested_by>
12
+ <created_at type="datetime">2010/07/27 21:53:16 UTC</created_at>
13
+ <updated_at type="datetime">2010/07/27 22:20:48 UTC</updated_at>
14
+ <notes type="array">
15
+ <note>
16
+ <id type="integer">2111593</id>
17
+ <text>This is a comment...whee!</text>
18
+ <author>Jon</author>
19
+ <noted_at type="datetime">2010/07/27 22:15:48 UTC</noted_at>
20
+ </note>
21
+ <note>
22
+ <id type="integer">2128955</id>
23
+ <text>Test note</text>
24
+ <author>Test Suite Access</author>
25
+ <noted_at type="datetime">2010/07/29 18:15:09 UTC</noted_at>
26
+ </note>
27
+ <note>
28
+ <id type="integer">2128959</id>
29
+ <text>Test note</text>
30
+ <author>Test Suite Access</author>
31
+ <noted_at type="datetime">2010/07/29 18:16:12 UTC</noted_at>
32
+ </note>
33
+ <note>
34
+ <id type="integer">2129077</id>
35
+ <text>Test note</text>
36
+ <author>Test Suite Access</author>
37
+ <noted_at type="datetime">2010/07/29 18:22:26 UTC</noted_at>
38
+ </note>
39
+ <note>
40
+ <id type="integer">2129374</id>
41
+ <text>Test note</text>
42
+ <author>Test Suite Access</author>
43
+ <noted_at type="datetime">2010/07/29 18:55:44 UTC</noted_at>
44
+ </note>
45
+ </notes>
46
+ </story>
@@ -0,0 +1,32 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <story>
3
+ <id type="integer">4460598</id>
4
+ <project_id type="integer">102622</project_id>
5
+ <story_type>feature</story_type>
6
+ <url>http://www.pivotaltracker.com/story/show/4460598</url>
7
+ <estimate type="integer">3</estimate>
8
+ <current_state>unstarted</current_state>
9
+ <description>This story has attachments.</description>
10
+ <name>Story with attachments</name>
11
+ <requested_by>Jon Mischo</requested_by>
12
+ <created_at type="datetime">2010/07/27 22:33:13 UTC</created_at>
13
+ <updated_at type="datetime">2010/07/27 22:33:28 UTC</updated_at>
14
+ <attachments type="array">
15
+ <attachment>
16
+ <id type="integer">491576</id>
17
+ <filename>LICENSE</filename>
18
+ <description></description>
19
+ <uploaded_by>Jon</uploaded_by>
20
+ <uploaded_at type="datetime">2010/07/27 22:34:23 UTC</uploaded_at>
21
+ <url>http://www.pivotaltracker.com/resource/download/491576</url>
22
+ </attachment>
23
+ <attachment>
24
+ <id type="integer">493019</id>
25
+ <filename>README.rdoc</filename>
26
+ <description>README file from api gem</description>
27
+ <uploaded_by>Jon</uploaded_by>
28
+ <uploaded_at type="datetime">2010/07/28 15:16:18 UTC</uploaded_at>
29
+ <url>http://www.pivotaltracker.com/resource/download/493019</url>
30
+ </attachment>
31
+ </attachments>
32
+ </story>
@@ -0,0 +1,48 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <story>
3
+ <id type="integer">4473735</id>
4
+ <project_id type="integer">102622</project_id>
5
+ <story_type>feature</story_type>
6
+ <url>http://www.pivotaltracker.com/story/show/4473735</url>
7
+ <estimate type="integer">1</estimate>
8
+ <current_state>unstarted</current_state>
9
+ <description></description>
10
+ <name>Attachment upload test story</name>
11
+ <requested_by>Jon</requested_by>
12
+ <created_at type="datetime">2010/07/28 18:17:33 UTC</created_at>
13
+ <updated_at type="datetime">2010/07/28 18:17:44 UTC</updated_at>
14
+ <attachments type="array">
15
+ <attachment>
16
+ <id type="integer">495851</id>
17
+ <filename>LICENSE</filename>
18
+ <description></description>
19
+ <uploaded_by>Test Suite Access</uploaded_by>
20
+ <uploaded_at type="datetime">2010/07/29 19:07:19 UTC</uploaded_at>
21
+ <url>http://www.pivotaltracker.com/resource/download/495851</url>
22
+ </attachment>
23
+ <attachment>
24
+ <id type="integer">495856</id>
25
+ <filename>LICENSE</filename>
26
+ <description></description>
27
+ <uploaded_by>Test Suite Access</uploaded_by>
28
+ <uploaded_at type="datetime">2010/07/29 19:09:27 UTC</uploaded_at>
29
+ <url>http://www.pivotaltracker.com/resource/download/495856</url>
30
+ </attachment>
31
+ <attachment>
32
+ <id type="integer">495858</id>
33
+ <filename>LICENSE</filename>
34
+ <description></description>
35
+ <uploaded_by>Test Suite Access</uploaded_by>
36
+ <uploaded_at type="datetime">2010/07/29 19:11:44 UTC</uploaded_at>
37
+ <url>http://www.pivotaltracker.com/resource/download/495858</url>
38
+ </attachment>
39
+ <attachment>
40
+ <id type="integer">495863</id>
41
+ <filename>LICENSE</filename>
42
+ <description></description>
43
+ <uploaded_by>Test Suite Access</uploaded_by>
44
+ <uploaded_at type="datetime">2010/07/29 19:13:06 UTC</uploaded_at>
45
+ <url>http://www.pivotaltracker.com/resource/download/495863</url>
46
+ </attachment>
47
+ </attachments>
48
+ </story>
data/spec/spec_helper.rb CHANGED
@@ -1,27 +1,34 @@
1
- require 'rubygems'
2
1
  require 'bundler'
3
- require 'stale_fish'
4
2
 
5
3
  Bundler.require(:default, :runtime, :test)
6
4
  $LOAD_PATH.unshift(File.dirname(__FILE__))
7
5
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
8
6
 
9
7
  require 'pivotal-tracker'
10
- require 'spec'
11
- require 'spec/autorun'
8
+ require 'rspec'
9
+ require 'rspec/autorun'
12
10
 
13
11
  PROJECT_ID = ENV['PROJECT_ID'] || "102622"
14
12
  TOKEN = '8358666c5a593a3c82cda728c8a62b63'
15
13
 
16
14
  PivotalTracker::Client.token = TOKEN
17
15
 
16
+ # tm: hack StaleFish
17
+ module StaleFish
18
+ class Fixture
19
+ def is_stale?
20
+ false
21
+ end
22
+ end
23
+ end
24
+
18
25
  # Requires supporting files with custom matchers and macros, etc,
19
26
  # in ./support/ and its subdirectories.
20
27
  Dir[File.expand_path(File.join(File.dirname(__FILE__),'support','**','*.rb'))].each {|f| require f}
21
28
 
22
29
  StaleFish.setup(File.join(File.dirname(__FILE__), 'fixtures', 'stale_fish.yml'))
23
30
 
24
- Spec::Runner.configure do |config|
31
+ RSpec.configure do |config|
25
32
  # config.include(Rack::Test::Methods)
26
33
 
27
34
  config.before :suite do
@@ -9,6 +9,10 @@ module StaleFishFixtures
9
9
  connection["/projects/102622"].get
10
10
  end
11
11
 
12
+ def update_story_fixture
13
+ connection["/projects/102622/stories/4460038"].get
14
+ end
15
+
12
16
  def update_stories_fixture
13
17
  connection["/projects/102622/stories?limit=20"].get
14
18
  end
@@ -23,7 +23,7 @@ describe PivotalTracker::Activity do
23
23
  context "with a specified occurred since date filter" do
24
24
  it "should correctly url encode the occurred since date filter in the API call" do
25
25
  PivotalTracker::Client.stub!(:connection).and_return connection = double("Client Connection")
26
- connection.should_receive(:[]).with("/activities?limit=100&occurred_since_date=2010/07/29%2019:13:00%20UTC")
26
+ connection.should_receive(:[]).with("/activities?limit=100&occurred_since_date=2010/07/29%2019:13:00%20+00:00")
27
27
  .and_return double("Connection", :get => '<blah></blah>')
28
28
  PivotalTracker::Activity.all nil, :limit => 100, :occurred_since_date => DateTime.parse("2010/7/29 19:13:00 UTC")
29
29
  end
@@ -1,87 +1,86 @@
1
1
  require "spec_helper"
2
- require 'ruby-debug'
3
2
 
4
3
  describe PivotalTracker::Client do
5
-
4
+
6
5
  describe ".connection" do
7
-
6
+
8
7
  context "with no existing token" do
9
-
8
+
10
9
  before do
11
10
  PivotalTracker::Client.token = nil
12
11
  end
13
-
12
+
14
13
  it "raises a NoToken exception" do
15
14
  lambda { PivotalTracker::Client.connection }.should raise_error(PivotalTracker::Client::NoToken)
16
15
  end
17
-
16
+
18
17
  describe "after setting a new token" do
19
-
18
+
20
19
  before do
21
20
  PivotalTracker::Client.token = "anewtoken"
22
21
  end
23
-
22
+
24
23
  it "called to RestClient::Resource using the new token" do
25
24
  RestClient::Resource.should_receive(:new).with("http://www.pivotaltracker.com/services/v3", :headers => {'X-TrackerToken' => "anewtoken", 'Content-Type' => 'application/xml'})
26
-
25
+
27
26
  PivotalTracker::Client.connection
28
27
  end
29
-
28
+
30
29
  it "returned the connection for the new token" do
31
30
  @resource = Object.new
32
-
31
+
33
32
  RestClient::Resource.should_receive(:new).
34
33
  with("http://www.pivotaltracker.com/services/v3", :headers => {'X-TrackerToken' => "anewtoken", 'Content-Type' => 'application/xml'}).
35
34
  and_return(@resource)
36
-
35
+
37
36
  PivotalTracker::Client.connection.should == @resource
38
37
  end
39
-
38
+
40
39
  end
41
-
40
+
42
41
  end
43
-
42
+
44
43
  context "with an existing token" do
45
-
44
+
46
45
  before do
47
46
  PivotalTracker::Client.token = "abc123"
48
47
  end
49
-
48
+
50
49
  it "returned a RestClient::Resource using the token" do
51
50
  @resource = Object.new
52
-
51
+
53
52
  RestClient::Resource.should_receive(:new).
54
53
  with("http://www.pivotaltracker.com/services/v3", :headers => {'X-TrackerToken' => "abc123", 'Content-Type' => 'application/xml'}).
55
54
  and_return(@resource)
56
-
55
+
57
56
  PivotalTracker::Client.connection.should == @resource
58
57
  end
59
-
58
+
60
59
  describe "after setting a new token" do
61
-
60
+
62
61
  before do
63
62
  PivotalTracker::Client.token = "anewtoken"
64
63
  end
65
-
64
+
66
65
  it "called to RestClient::Resource using the new token" do
67
66
  RestClient::Resource.should_receive(:new).with("http://www.pivotaltracker.com/services/v3", :headers => {'X-TrackerToken' => "anewtoken", 'Content-Type' => 'application/xml'})
68
-
67
+
69
68
  PivotalTracker::Client.connection
70
69
  end
71
-
70
+
72
71
  it "returned the connection for the new token" do
73
72
  @resource = Object.new
74
-
73
+
75
74
  RestClient::Resource.should_receive(:new).
76
75
  with("http://www.pivotaltracker.com/services/v3", :headers => {'X-TrackerToken' => "anewtoken", 'Content-Type' => 'application/xml'}).
77
76
  and_return(@resource)
78
-
77
+
79
78
  PivotalTracker::Client.connection.should == @resource
80
79
  end
81
-
80
+
82
81
  end
83
-
82
+
84
83
  end
85
84
  end
86
-
87
- end
85
+
86
+ end
@@ -2,6 +2,7 @@ require 'spec_helper'
2
2
 
3
3
  describe PivotalTracker::Iteration do
4
4
  before do
5
+ PivotalTracker::Client.token = TOKEN
5
6
  @project = PivotalTracker::Project.find(PROJECT_ID)
6
7
  end
7
8
 
@@ -3,6 +3,7 @@ require 'spec_helper'
3
3
  describe PivotalTracker::Project do
4
4
  context ".all" do
5
5
  before do
6
+ PivotalTracker::Client.token = TOKEN
6
7
  @projects = PivotalTracker::Project.all
7
8
  end
8
9
 
@@ -55,6 +55,7 @@ describe PivotalTracker::Story do
55
55
 
56
56
  context ".move_to_project" do
57
57
  before(:each) do
58
+ pending
58
59
  @orig_net_lock = FakeWeb.allow_net_connect?
59
60
  FakeWeb.allow_net_connect = true
60
61
  @target_project = PivotalTracker::Project.find(103014)
@@ -83,6 +84,7 @@ describe PivotalTracker::Story do
83
84
  end
84
85
 
85
86
  after (:each) do
87
+ pending
86
88
  @movable_story = @target_project.stories.find(4490874)
87
89
  response = @movable_story.move_to_project(102622)
88
90
  FakeWeb.allow_net_connect = @orig_net_lock
@@ -160,22 +162,29 @@ describe PivotalTracker::Story do
160
162
  # story_for(:jira_url => "somewhere")["jira_url"].should == "somewhere"
161
163
  # end
162
164
 
163
- [:created_at, :accepted_at].each do |date_attribute|
164
- it "should include #{date_attribute} date when given a string" do
165
- story_for(:created_at => '9/20/1984, 10:23am UTC')["created_at"].should == "1984-09-20T10:23:00+00:00"
165
+ context "date attributes" do
166
+ before do
167
+ @datestring = "1984-09-20T10:23:00+00:00"
168
+ @date = DateTime.new(1984, 9, 20, 10, 23, 0, 0)
166
169
  end
167
170
 
168
- it "should include #{date_attribute} date when given a Time" do
169
- story_for(:created_at => Time.parse('9/20/1984, 10:23am UTC'))["created_at"].should == "1984-09-20T10:23:00+00:00"
170
- end
171
+ [:created_at, :accepted_at].each do |date_attribute|
172
+ it "should include #{date_attribute} date when given a string" do
173
+ story_for(:created_at => @date.to_s)["created_at"].should == @datestring
174
+ end
171
175
 
172
- it "should include #{date_attribute} date when given a DateTime" do
173
- story_for(:created_at => DateTime.parse('9/20/1984, 10:23am UTC'))["created_at"].should == "1984-09-20T10:23:00+00:00"
174
- end
176
+ it "should include #{date_attribute} date when given a Time" do
177
+ story_for(:created_at => Time.parse(@date.to_s).utc)["created_at"].should == @datestring
178
+ end
179
+
180
+ it "should include #{date_attribute} date when given a DateTime" do
181
+ story_for(:created_at => @date)["created_at"].should == @datestring
182
+ end
175
183
 
176
- it "should include #{date_attribute} date when given a Date" do
177
- # Dates don't have time zones, but the time will be in local time, so we convert the date to create the expectation
178
- story_for(:created_at => Date.parse('9/20/1984'))["created_at"].should == DateTime.parse('9/20/1984').to_s
184
+ it "should include #{date_attribute} date when given a Date" do
185
+ # Dates don't have time zones, but the time will be in local time, so we convert the date to create the expectation
186
+ story_for(:created_at => Date.new(1984, 9, 20))["created_at"].should == DateTime.new(1984, 9, 20).to_s
187
+ end
179
188
  end
180
189
  end
181
190
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pivotal-tracker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,11 +11,11 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2012-02-15 00:00:00.000000000 Z
14
+ date: 2012-02-17 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rest-client
18
- requirement: &70278836038760 !ruby/object:Gem::Requirement
18
+ requirement: &70345625577060 !ruby/object:Gem::Requirement
19
19
  none: false
20
20
  requirements:
21
21
  - - ~>
@@ -23,10 +23,10 @@ dependencies:
23
23
  version: 1.6.0
24
24
  type: :runtime
25
25
  prerelease: false
26
- version_requirements: *70278836038760
26
+ version_requirements: *70345625577060
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: happymapper
29
- requirement: &70278836038280 !ruby/object:Gem::Requirement
29
+ requirement: &70345625576320 !ruby/object:Gem::Requirement
30
30
  none: false
31
31
  requirements:
32
32
  - - ! '>='
@@ -34,10 +34,10 @@ dependencies:
34
34
  version: 0.3.2
35
35
  type: :runtime
36
36
  prerelease: false
37
- version_requirements: *70278836038280
37
+ version_requirements: *70345625576320
38
38
  - !ruby/object:Gem::Dependency
39
39
  name: builder
40
- requirement: &70278836037800 !ruby/object:Gem::Requirement
40
+ requirement: &70345625575500 !ruby/object:Gem::Requirement
41
41
  none: false
42
42
  requirements:
43
43
  - - ! '>='
@@ -45,10 +45,10 @@ dependencies:
45
45
  version: '0'
46
46
  type: :runtime
47
47
  prerelease: false
48
- version_requirements: *70278836037800
48
+ version_requirements: *70345625575500
49
49
  - !ruby/object:Gem::Dependency
50
50
  name: nokogiri
51
- requirement: &70278836037320 !ruby/object:Gem::Requirement
51
+ requirement: &70345625574820 !ruby/object:Gem::Requirement
52
52
  none: false
53
53
  requirements:
54
54
  - - ~>
@@ -56,10 +56,10 @@ dependencies:
56
56
  version: '1.4'
57
57
  type: :runtime
58
58
  prerelease: false
59
- version_requirements: *70278836037320
59
+ version_requirements: *70345625574820
60
60
  - !ruby/object:Gem::Dependency
61
61
  name: rest-client
62
- requirement: &70278835501260 !ruby/object:Gem::Requirement
62
+ requirement: &70345625589960 !ruby/object:Gem::Requirement
63
63
  none: false
64
64
  requirements:
65
65
  - - ~>
@@ -67,10 +67,10 @@ dependencies:
67
67
  version: 1.6.0
68
68
  type: :runtime
69
69
  prerelease: false
70
- version_requirements: *70278835501260
70
+ version_requirements: *70345625589960
71
71
  - !ruby/object:Gem::Dependency
72
72
  name: happymapper
73
- requirement: &70278835500640 !ruby/object:Gem::Requirement
73
+ requirement: &70345625589240 !ruby/object:Gem::Requirement
74
74
  none: false
75
75
  requirements:
76
76
  - - ! '>='
@@ -78,10 +78,10 @@ dependencies:
78
78
  version: 0.3.2
79
79
  type: :runtime
80
80
  prerelease: false
81
- version_requirements: *70278835500640
81
+ version_requirements: *70345625589240
82
82
  - !ruby/object:Gem::Dependency
83
83
  name: builder
84
- requirement: &70278835499920 !ruby/object:Gem::Requirement
84
+ requirement: &70345625588620 !ruby/object:Gem::Requirement
85
85
  none: false
86
86
  requirements:
87
87
  - - ! '>='
@@ -89,10 +89,10 @@ dependencies:
89
89
  version: '0'
90
90
  type: :runtime
91
91
  prerelease: false
92
- version_requirements: *70278835499920
92
+ version_requirements: *70345625588620
93
93
  - !ruby/object:Gem::Dependency
94
94
  name: nokogiri
95
- requirement: &70278835499060 !ruby/object:Gem::Requirement
95
+ requirement: &70345625587720 !ruby/object:Gem::Requirement
96
96
  none: false
97
97
  requirements:
98
98
  - - ! '>='
@@ -100,10 +100,10 @@ dependencies:
100
100
  version: 1.4.3
101
101
  type: :runtime
102
102
  prerelease: false
103
- version_requirements: *70278835499060
103
+ version_requirements: *70345625587720
104
104
  - !ruby/object:Gem::Dependency
105
105
  name: rspec
106
- requirement: &70278835498360 !ruby/object:Gem::Requirement
106
+ requirement: &70345625586960 !ruby/object:Gem::Requirement
107
107
  none: false
108
108
  requirements:
109
109
  - - ! '>='
@@ -111,10 +111,10 @@ dependencies:
111
111
  version: '0'
112
112
  type: :development
113
113
  prerelease: false
114
- version_requirements: *70278835498360
114
+ version_requirements: *70345625586960
115
115
  - !ruby/object:Gem::Dependency
116
116
  name: bundler
117
- requirement: &70278835497640 !ruby/object:Gem::Requirement
117
+ requirement: &70345625586180 !ruby/object:Gem::Requirement
118
118
  none: false
119
119
  requirements:
120
120
  - - ~>
@@ -122,10 +122,10 @@ dependencies:
122
122
  version: 1.0.12
123
123
  type: :development
124
124
  prerelease: false
125
- version_requirements: *70278835497640
125
+ version_requirements: *70345625586180
126
126
  - !ruby/object:Gem::Dependency
127
127
  name: jeweler
128
- requirement: &70278835496780 !ruby/object:Gem::Requirement
128
+ requirement: &70345625585620 !ruby/object:Gem::Requirement
129
129
  none: false
130
130
  requirements:
131
131
  - - ! '>='
@@ -133,10 +133,10 @@ dependencies:
133
133
  version: '0'
134
134
  type: :development
135
135
  prerelease: false
136
- version_requirements: *70278835496780
136
+ version_requirements: *70345625585620
137
137
  - !ruby/object:Gem::Dependency
138
138
  name: stale_fish
139
- requirement: &70278835495780 !ruby/object:Gem::Requirement
139
+ requirement: &70345625584560 !ruby/object:Gem::Requirement
140
140
  none: false
141
141
  requirements:
142
142
  - - ~>
@@ -144,7 +144,7 @@ dependencies:
144
144
  version: 1.3.0
145
145
  type: :development
146
146
  prerelease: false
147
- version_requirements: *70278835495780
147
+ version_requirements: *70345625584560
148
148
  description:
149
149
  email: justin.smestad@gmail.com
150
150
  executables: []
@@ -153,6 +153,7 @@ extra_rdoc_files:
153
153
  - LICENSE
154
154
  - README.rdoc
155
155
  files:
156
+ - .rspec
156
157
  - Gemfile
157
158
  - Gemfile.lock
158
159
  - LICENSE
@@ -188,6 +189,10 @@ files:
188
189
  - spec/fixtures/projects.xml
189
190
  - spec/fixtures/stale_fish.yml
190
191
  - spec/fixtures/stories.xml
192
+ - spec/fixtures/story-4459994.xml
193
+ - spec/fixtures/story-4460038.xml
194
+ - spec/fixtures/story-4460598.xml
195
+ - spec/fixtures/story-4473735.xml
191
196
  - spec/fixtures/tasks.xml
192
197
  - spec/spec.opts
193
198
  - spec/spec_helper.rb
@@ -215,7 +220,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
215
220
  version: '0'
216
221
  segments:
217
222
  - 0
218
- hash: 3342751684468911007
223
+ hash: 1361182168385878277
219
224
  required_rubygems_version: !ruby/object:Gem::Requirement
220
225
  none: false
221
226
  requirements: