ranking 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/ranking/instance_methods.rb +4 -0
- data/ranking.gemspec +1 -1
- data/spec/instance_methods_spec.rb +18 -0
- metadata +3 -3
data/ranking.gemspec
CHANGED
@@ -81,4 +81,22 @@ describe Ranking::InstanceMethods do
|
|
81
81
|
expect { @instance.score(:foo) }.to raise_error(ArgumentError)
|
82
82
|
end
|
83
83
|
end
|
84
|
+
|
85
|
+
describe "#[]" do
|
86
|
+
before(:each) do
|
87
|
+
@instance.score(:foo, 5).score(:bar, 4).score(:baz, 3).score(:qux,2)
|
88
|
+
end
|
89
|
+
|
90
|
+
it "indexes" do
|
91
|
+
@instance[1].should == :bar
|
92
|
+
end
|
93
|
+
|
94
|
+
it "slices with .." do
|
95
|
+
@instance[1..2].should == [:bar, :baz]
|
96
|
+
end
|
97
|
+
|
98
|
+
it "slices with ..." do
|
99
|
+
@instance[1...3].should == [:bar, :baz]
|
100
|
+
end
|
101
|
+
end
|
84
102
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ranking
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -64,7 +64,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
64
64
|
version: '0'
|
65
65
|
segments:
|
66
66
|
- 0
|
67
|
-
hash:
|
67
|
+
hash: 1644303560493458915
|
68
68
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
69
69
|
none: false
|
70
70
|
requirements:
|
@@ -73,7 +73,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
73
73
|
version: '0'
|
74
74
|
segments:
|
75
75
|
- 0
|
76
|
-
hash:
|
76
|
+
hash: 1644303560493458915
|
77
77
|
requirements: []
|
78
78
|
rubyforge_project:
|
79
79
|
rubygems_version: 1.8.23
|