artisan-repository 0.0.5 → 0.0.11

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,23 +1,34 @@
1
1
  shared_examples "change repository" do
2
2
  let (:repo) { described_class.new }
3
-
3
+
4
4
  it "has a project change" do
5
5
  repo.create_project_change(:source_id => 3, :user_id => 2, :event => :second, :project_id => 123).type.should == "ProjectChange"
6
6
  end
7
-
7
+
8
8
  it "has an iteration change" do
9
9
  repo.create_iteration_change(:source_id => 3, :user_id => 2, :event => :second, :project_id => 123).type.should == "IterationChange"
10
10
  end
11
-
11
+
12
12
  it "has a story change" do
13
13
  repo.create_story_change(:source_id => 3, :user_id => 2, :event => :second, :project_id => 123).type.should == "StoryChange"
14
14
  end
15
-
16
- it "orders by created_at project" do
15
+
16
+ it "orders by created_at (newest first)" do
17
17
  second = repo.create_project_change(:source_id => 3, :user_id => 2, :event => "second", :project_id => 123, :created_at => Time.now)
18
- first = repo.create_project_change(:source_id => 1, :user_id => 2, :event => "first", :project_id => 123, :created_at => (Time.now - 25 ))
19
-
18
+ first = repo.create_project_change(:source_id => 1, :user_id => 2, :event => "first", :project_id => 123, :created_at => (Time.now - 25))
19
+
20
20
  repo.find_all_by_project_id(123).map(&:event).should == ["second", "first"]
21
21
  end
22
-
22
+
23
+ it "can find a range of items" do
24
+ time = Time.now
25
+
26
+ (0..30).each do |i|
27
+ repo.create_project_change(:source_id => 3, :user_id => 2, :event => i.to_s, :project_id => 123, :created_at => time - i)
28
+ end
29
+
30
+ repo.find_range_by_project_id(123, 0, 10).map(&:event).should == (0..10).to_a.map(&:to_s)
31
+ repo.find_range_by_project_id(123, 10, 20).map(&:event).should == (10..20).to_a.map(&:to_s)
32
+ repo.find_range_by_project_id(123, 20, 30).map(&:event).should == (20..30).to_a.map(&:to_s)
33
+ end
23
34
  end
metadata CHANGED
@@ -1,27 +1,22 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: artisan-repository
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.11
4
5
  prerelease:
5
- version: 0.0.5
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - 8th Light Craftsmen
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
-
13
- date: 2012-10-13 00:00:00 Z
12
+ date: 2013-01-10 00:00:00.000000000 Z
14
13
  dependencies: []
15
-
16
14
  description: An interface to the Artisan persistance layer
17
15
  email: paul@8thlight.com
18
16
  executables: []
19
-
20
17
  extensions: []
21
-
22
18
  extra_rdoc_files: []
23
-
24
- files:
19
+ files:
25
20
  - lib/artisan/repository.rb
26
21
  - lib/artisan/shared_examples/change_examples.rb
27
22
  - lib/artisan/shared_examples/future_user_examples.rb
@@ -31,33 +26,26 @@ files:
31
26
  - lib/artisan/shared_examples/user_examples.rb
32
27
  homepage: http://8thlight.com
33
28
  licenses: []
34
-
35
29
  post_install_message:
36
30
  rdoc_options: []
37
-
38
- require_paths:
31
+ require_paths:
39
32
  - lib
40
- required_ruby_version: !ruby/object:Gem::Requirement
33
+ required_ruby_version: !ruby/object:Gem::Requirement
41
34
  none: false
42
- requirements:
43
- - - ">="
44
- - !ruby/object:Gem::Version
45
- hash: -3174594710508127497
46
- segments:
47
- - 0
48
- version: "0"
49
- required_rubygems_version: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - ! '>='
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
39
+ required_rubygems_version: !ruby/object:Gem::Requirement
50
40
  none: false
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- version: "0"
41
+ requirements:
42
+ - - ! '>='
43
+ - !ruby/object:Gem::Version
44
+ version: '0'
55
45
  requirements: []
56
-
57
46
  rubyforge_project:
58
47
  rubygems_version: 1.8.24
59
48
  signing_key:
60
49
  specification_version: 3
61
50
  summary: Artisan RepositorySpec
62
51
  test_files: []
63
-