bicycle 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.rubocop.yml +1 -1
- data/.ruby-version +1 -1
- data/Gemfile +1 -1
- data/Gemfile.lock +11 -11
- data/Rakefile +2 -2
- data/VERSION +1 -1
- data/bicycle.gemspec +11 -11
- data/test/bicycle/methods_test.rb +116 -0
- data/test/dummy_app.rb +5 -0
- data/test/helper.rb +6 -3
- metadata +10 -10
- data/.ruby-gemset +0 -1
- data/test/test_bicycle.rb +0 -109
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 69279c48a0dd5aef4481863bafcbc14a7db094bbca51f01ae76227e7ba89e6e1
|
4
|
+
data.tar.gz: 5c3eb8cf5da74d48468176c3e2f208b97253373df3d387e098c9a09ad63ce23d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 539d6a18de19cc8285868d85962010a5e33ceff79c6ee2e731bc1144736e7b434db7bc1c464948bbf8c00562b4750c073ce9fcf0b26f3c3d0320b4013f3299a0
|
7
|
+
data.tar.gz: 82a85fde28e036742aa66b1314d48bab1699d6ba699f046835f2e4773499ffb9a75dc988abde7523453b22f775b718013877eaf424410349162738dbfe435cb8
|
data/.rubocop.yml
CHANGED
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.5.1
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -8,7 +8,7 @@ GEM
|
|
8
8
|
thread_safe (~> 0.3, >= 0.3.1)
|
9
9
|
faraday (0.9.2)
|
10
10
|
multipart-post (>= 1.2, < 3)
|
11
|
-
git (1.
|
11
|
+
git (1.5.0)
|
12
12
|
github_api (0.16.0)
|
13
13
|
addressable (~> 2.4.0)
|
14
14
|
descendants_tracker (~> 0.0.4)
|
@@ -16,8 +16,8 @@ GEM
|
|
16
16
|
hashie (>= 3.4)
|
17
17
|
mime-types (>= 1.16, < 3.0)
|
18
18
|
oauth2 (~> 1.0)
|
19
|
-
hashie (3.
|
20
|
-
highline (
|
19
|
+
hashie (3.6.0)
|
20
|
+
highline (2.0.0)
|
21
21
|
jeweler (2.3.9)
|
22
22
|
builder
|
23
23
|
bundler
|
@@ -35,7 +35,7 @@ GEM
|
|
35
35
|
minitest (5.11.3)
|
36
36
|
minitest-fail-fast (0.1.0)
|
37
37
|
minitest (~> 5)
|
38
|
-
minitest-reporters (1.
|
38
|
+
minitest-reporters (1.3.0)
|
39
39
|
ansi
|
40
40
|
builder
|
41
41
|
minitest (>= 5.0)
|
@@ -43,7 +43,7 @@ GEM
|
|
43
43
|
multi_json (1.13.1)
|
44
44
|
multi_xml (0.6.0)
|
45
45
|
multipart-post (2.0.0)
|
46
|
-
nokogiri (1.8.
|
46
|
+
nokogiri (1.8.4)
|
47
47
|
mini_portile2 (~> 2.3.0)
|
48
48
|
oauth2 (1.4.0)
|
49
49
|
faraday (>= 0.8, < 0.13)
|
@@ -52,13 +52,13 @@ GEM
|
|
52
52
|
multi_xml (~> 0.5)
|
53
53
|
rack (>= 1.2, < 3)
|
54
54
|
psych (3.0.2)
|
55
|
-
rack (2.0.
|
55
|
+
rack (2.0.5)
|
56
56
|
rake (12.3.1)
|
57
|
-
rdoc (6.0.
|
58
|
-
ruby-progressbar (1.
|
57
|
+
rdoc (6.0.4)
|
58
|
+
ruby-progressbar (1.10.0)
|
59
59
|
semver2 (3.4.2)
|
60
60
|
thread_safe (0.3.6)
|
61
|
-
yard (0.9.
|
61
|
+
yard (0.9.16)
|
62
62
|
|
63
63
|
PLATFORMS
|
64
64
|
ruby
|
@@ -68,8 +68,8 @@ DEPENDENCIES
|
|
68
68
|
jeweler (~> 2.3)
|
69
69
|
minitest (~> 5.0)
|
70
70
|
minitest-fail-fast (~> 0.1)
|
71
|
-
minitest-reporters (
|
71
|
+
minitest-reporters (= 1.3.0)
|
72
72
|
yard (~> 0.9.7)
|
73
73
|
|
74
74
|
BUNDLED WITH
|
75
|
-
1.16.
|
75
|
+
1.16.3
|
data/Rakefile
CHANGED
@@ -19,7 +19,7 @@ Jeweler::Tasks.new do |gem|
|
|
19
19
|
gem.license = "MIT"
|
20
20
|
gem.summary = %(Why walk when you can cycle)
|
21
21
|
gem.description = %(A convenience gem for cycling through a set of values, ported from the 'cycle' functionality found in Rails. It is independent of which framework you use so will run in Sinatra, Padrino or straight up Ruby itself.)
|
22
|
-
gem.email = "stuart.chinery@
|
22
|
+
gem.email = "stuart.chinery@gmail.com"
|
23
23
|
gem.authors = ["Stuart Chinery", "Dave Hrycyszyn"]
|
24
24
|
# dependencies defined in Gemfile
|
25
25
|
end
|
@@ -28,7 +28,7 @@ Jeweler::RubygemsDotOrgTasks.new
|
|
28
28
|
require "rake/testtask"
|
29
29
|
Rake::TestTask.new(:test) do |test|
|
30
30
|
test.libs << "lib" << "test"
|
31
|
-
test.pattern = "test
|
31
|
+
test.pattern = "test/**/*_test.rb"
|
32
32
|
test.verbose = true
|
33
33
|
end
|
34
34
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.1
|
data/bicycle.gemspec
CHANGED
@@ -2,18 +2,18 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: bicycle 0.5.
|
5
|
+
# stub: bicycle 0.5.1 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "bicycle".freeze
|
9
|
-
s.version = "0.5.
|
9
|
+
s.version = "0.5.1"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib".freeze]
|
13
13
|
s.authors = ["Stuart Chinery".freeze, "Dave Hrycyszyn".freeze]
|
14
|
-
s.date = "2018-
|
14
|
+
s.date = "2018-08-15"
|
15
15
|
s.description = "A convenience gem for cycling through a set of values, ported from the 'cycle' functionality found in Rails. It is independent of which framework you use so will run in Sinatra, Padrino or straight up Ruby itself.".freeze
|
16
|
-
s.email = "stuart.chinery@
|
16
|
+
s.email = "stuart.chinery@gmail.com".freeze
|
17
17
|
s.extra_rdoc_files = [
|
18
18
|
"LICENSE.txt",
|
19
19
|
"README.md"
|
@@ -21,7 +21,6 @@ Gem::Specification.new do |s|
|
|
21
21
|
s.files = [
|
22
22
|
".document",
|
23
23
|
".rubocop.yml",
|
24
|
-
".ruby-gemset",
|
25
24
|
".ruby-version",
|
26
25
|
".travis.yml",
|
27
26
|
"Gemfile",
|
@@ -33,12 +32,13 @@ Gem::Specification.new do |s|
|
|
33
32
|
"bicycle.gemspec",
|
34
33
|
"lib/bicycle.rb",
|
35
34
|
"lib/bicycle/methods.rb",
|
36
|
-
"test/
|
37
|
-
"test/
|
35
|
+
"test/bicycle/methods_test.rb",
|
36
|
+
"test/dummy_app.rb",
|
37
|
+
"test/helper.rb"
|
38
38
|
]
|
39
39
|
s.homepage = "http://github.com/sleepingstu/bicycle".freeze
|
40
40
|
s.licenses = ["MIT".freeze]
|
41
|
-
s.rubygems_version = "2.6
|
41
|
+
s.rubygems_version = "2.7.6".freeze
|
42
42
|
s.summary = "Why walk when you can cycle".freeze
|
43
43
|
|
44
44
|
if s.respond_to? :specification_version then
|
@@ -49,14 +49,14 @@ Gem::Specification.new do |s|
|
|
49
49
|
s.add_development_dependency(%q<jeweler>.freeze, ["~> 2.3"])
|
50
50
|
s.add_development_dependency(%q<minitest>.freeze, ["~> 5.0"])
|
51
51
|
s.add_development_dependency(%q<minitest-fail-fast>.freeze, ["~> 0.1"])
|
52
|
-
s.add_development_dependency(%q<minitest-reporters>.freeze, ["
|
52
|
+
s.add_development_dependency(%q<minitest-reporters>.freeze, ["= 1.3.0"])
|
53
53
|
s.add_development_dependency(%q<yard>.freeze, ["~> 0.9.7"])
|
54
54
|
else
|
55
55
|
s.add_dependency(%q<bundler>.freeze, ["~> 1.16"])
|
56
56
|
s.add_dependency(%q<jeweler>.freeze, ["~> 2.3"])
|
57
57
|
s.add_dependency(%q<minitest>.freeze, ["~> 5.0"])
|
58
58
|
s.add_dependency(%q<minitest-fail-fast>.freeze, ["~> 0.1"])
|
59
|
-
s.add_dependency(%q<minitest-reporters>.freeze, ["
|
59
|
+
s.add_dependency(%q<minitest-reporters>.freeze, ["= 1.3.0"])
|
60
60
|
s.add_dependency(%q<yard>.freeze, ["~> 0.9.7"])
|
61
61
|
end
|
62
62
|
else
|
@@ -64,7 +64,7 @@ Gem::Specification.new do |s|
|
|
64
64
|
s.add_dependency(%q<jeweler>.freeze, ["~> 2.3"])
|
65
65
|
s.add_dependency(%q<minitest>.freeze, ["~> 5.0"])
|
66
66
|
s.add_dependency(%q<minitest-fail-fast>.freeze, ["~> 0.1"])
|
67
|
-
s.add_dependency(%q<minitest-reporters>.freeze, ["
|
67
|
+
s.add_dependency(%q<minitest-reporters>.freeze, ["= 1.3.0"])
|
68
68
|
s.add_dependency(%q<yard>.freeze, ["~> 0.9.7"])
|
69
69
|
end
|
70
70
|
end
|
@@ -0,0 +1,116 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "helper"
|
4
|
+
require "dummy_app"
|
5
|
+
|
6
|
+
module Bicycle
|
7
|
+
class MethodsTest < Minitest::Test
|
8
|
+
let(:app) { DummyApp.new }
|
9
|
+
let(:values) { [] }
|
10
|
+
|
11
|
+
describe Bicycle::Methods do
|
12
|
+
describe "#cycle" do
|
13
|
+
describe "with values" do
|
14
|
+
before do
|
15
|
+
(0..3).each do |idx|
|
16
|
+
values[idx] = app.cycle("Foo", "Bar", "Huh?")
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
it "should return a value in the cycle order" do
|
21
|
+
assert_equal "Foo", values[0]
|
22
|
+
assert_equal "Bar", values[1]
|
23
|
+
assert_equal "Huh?", values[2]
|
24
|
+
assert_equal "Foo", values[3]
|
25
|
+
end
|
26
|
+
|
27
|
+
describe "and with new values" do
|
28
|
+
before do
|
29
|
+
(0..5).each do |idx|
|
30
|
+
values[idx] = app.cycle("I", "just", "want", "to", "ride", name: "bikes")
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
it "should return a new value in the cycle order" do
|
35
|
+
assert_equal "I", values[0]
|
36
|
+
assert_equal "just", values[1]
|
37
|
+
assert_equal "want", values[2]
|
38
|
+
assert_equal "to", values[3]
|
39
|
+
assert_equal "ride", values[4]
|
40
|
+
assert_equal "I", values[0]
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
describe "with multiple instances in one loop" do
|
46
|
+
let(:sub_values) { [] }
|
47
|
+
|
48
|
+
before do
|
49
|
+
(0..3).each do |idx|
|
50
|
+
values[idx] = app.cycle("Foo", "Bar", "Huh?")
|
51
|
+
other_values = []
|
52
|
+
|
53
|
+
(0..5).each do |second_idx|
|
54
|
+
other_values[second_idx] = app.cycle("I", "just", "want", "to", "ride", name: "bikes")
|
55
|
+
end
|
56
|
+
|
57
|
+
sub_values[idx] = other_values
|
58
|
+
app.reset_cycle("bikes")
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
it "should return a value from the first cycle order" do
|
63
|
+
assert_equal "Foo", values[0]
|
64
|
+
assert_equal "Bar", values[1]
|
65
|
+
assert_equal "Huh?", values[2]
|
66
|
+
assert_equal "Foo", values[3]
|
67
|
+
end
|
68
|
+
|
69
|
+
it "should return a value from the first bike cycle order" do
|
70
|
+
assert_equal "I", sub_values[0][0]
|
71
|
+
assert_equal "just", sub_values[0][1]
|
72
|
+
assert_equal "want", sub_values[0][2]
|
73
|
+
assert_equal "to", sub_values[0][3]
|
74
|
+
assert_equal "ride", sub_values[0][4]
|
75
|
+
assert_equal "I", sub_values[0][0]
|
76
|
+
end
|
77
|
+
|
78
|
+
it "should return a value from the second bike cycle order" do
|
79
|
+
assert_equal "I", sub_values[1][0]
|
80
|
+
assert_equal "just", sub_values[1][1]
|
81
|
+
assert_equal "want", sub_values[1][2]
|
82
|
+
assert_equal "to", sub_values[1][3]
|
83
|
+
assert_equal "ride", sub_values[1][4]
|
84
|
+
assert_equal "I", sub_values[1][0]
|
85
|
+
end
|
86
|
+
|
87
|
+
it "should return a value from the third bike cycle order" do
|
88
|
+
assert_equal "I", sub_values[2][0]
|
89
|
+
assert_equal "just", sub_values[2][1]
|
90
|
+
assert_equal "want", sub_values[2][2]
|
91
|
+
assert_equal "to", sub_values[2][3]
|
92
|
+
assert_equal "ride", sub_values[2][4]
|
93
|
+
assert_equal "I", sub_values[2][0]
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
describe "#current_cycle" do
|
99
|
+
let(:current_cycle) { [] }
|
100
|
+
|
101
|
+
before do
|
102
|
+
(0..5).each do |idx|
|
103
|
+
values[idx] = app.cycle("I", "just", "want", "to", "ride")
|
104
|
+
current_cycle[idx] = app.current_cycle
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
it "should match whats cycled" do
|
109
|
+
(0..5).each do |idx|
|
110
|
+
assert_equal values[idx], current_cycle[idx]
|
111
|
+
end
|
112
|
+
end
|
113
|
+
end
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
data/test/dummy_app.rb
ADDED
data/test/helper.rb
CHANGED
@@ -14,14 +14,17 @@ $LOAD_PATH.unshift(File.dirname(__FILE__))
|
|
14
14
|
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
|
15
15
|
require "bicycle"
|
16
16
|
|
17
|
+
require "minitest/spec"
|
17
18
|
require "minitest/autorun"
|
18
|
-
require "minitest/fail_fast"
|
19
19
|
require "minitest/reporters"
|
20
|
+
require "minitest/fail_fast"
|
21
|
+
|
22
|
+
class Minitest::Test
|
23
|
+
extend Minitest::Spec::DSL
|
24
|
+
end
|
20
25
|
|
21
26
|
Minitest::Reporters.use!(
|
22
27
|
Minitest::Reporters::SpecReporter.new,
|
23
28
|
ENV,
|
24
29
|
Minitest.backtrace_filter
|
25
30
|
)
|
26
|
-
|
27
|
-
MiniTest::Unit.autorun
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bicycle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stuart Chinery
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-
|
12
|
+
date: 2018-08-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -71,16 +71,16 @@ dependencies:
|
|
71
71
|
name: minitest-reporters
|
72
72
|
requirement: !ruby/object:Gem::Requirement
|
73
73
|
requirements:
|
74
|
-
- -
|
74
|
+
- - '='
|
75
75
|
- !ruby/object:Gem::Version
|
76
|
-
version:
|
76
|
+
version: 1.3.0
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
79
|
version_requirements: !ruby/object:Gem::Requirement
|
80
80
|
requirements:
|
81
|
-
- -
|
81
|
+
- - '='
|
82
82
|
- !ruby/object:Gem::Version
|
83
|
-
version:
|
83
|
+
version: 1.3.0
|
84
84
|
- !ruby/object:Gem::Dependency
|
85
85
|
name: yard
|
86
86
|
requirement: !ruby/object:Gem::Requirement
|
@@ -98,7 +98,7 @@ dependencies:
|
|
98
98
|
description: A convenience gem for cycling through a set of values, ported from the
|
99
99
|
'cycle' functionality found in Rails. It is independent of which framework you use
|
100
100
|
so will run in Sinatra, Padrino or straight up Ruby itself.
|
101
|
-
email: stuart.chinery@
|
101
|
+
email: stuart.chinery@gmail.com
|
102
102
|
executables: []
|
103
103
|
extensions: []
|
104
104
|
extra_rdoc_files:
|
@@ -107,7 +107,6 @@ extra_rdoc_files:
|
|
107
107
|
files:
|
108
108
|
- ".document"
|
109
109
|
- ".rubocop.yml"
|
110
|
-
- ".ruby-gemset"
|
111
110
|
- ".ruby-version"
|
112
111
|
- ".travis.yml"
|
113
112
|
- Gemfile
|
@@ -119,8 +118,9 @@ files:
|
|
119
118
|
- bicycle.gemspec
|
120
119
|
- lib/bicycle.rb
|
121
120
|
- lib/bicycle/methods.rb
|
121
|
+
- test/bicycle/methods_test.rb
|
122
|
+
- test/dummy_app.rb
|
122
123
|
- test/helper.rb
|
123
|
-
- test/test_bicycle.rb
|
124
124
|
homepage: http://github.com/sleepingstu/bicycle
|
125
125
|
licenses:
|
126
126
|
- MIT
|
@@ -141,7 +141,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
141
141
|
version: '0'
|
142
142
|
requirements: []
|
143
143
|
rubyforge_project:
|
144
|
-
rubygems_version: 2.6
|
144
|
+
rubygems_version: 2.7.6
|
145
145
|
signing_key:
|
146
146
|
specification_version: 4
|
147
147
|
summary: Why walk when you can cycle
|
data/.ruby-gemset
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
bicycle
|
data/test/test_bicycle.rb
DELETED
@@ -1,109 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "helper"
|
4
|
-
include Bicycle
|
5
|
-
|
6
|
-
describe "When cycling" do
|
7
|
-
describe "with values" do
|
8
|
-
before do
|
9
|
-
@values = []
|
10
|
-
(0..3).each do |i|
|
11
|
-
@values[i] = cycle("Foo", "Bar", "Huh?")
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
it "should return a value in the cycle order" do
|
16
|
-
assert_equal "Foo", @values[0]
|
17
|
-
assert_equal "Bar", @values[1]
|
18
|
-
assert_equal "Huh?", @values[2]
|
19
|
-
assert_equal "Foo", @values[3]
|
20
|
-
end
|
21
|
-
|
22
|
-
describe "and with new values" do
|
23
|
-
before do
|
24
|
-
@values = []
|
25
|
-
(0..5).each do |i|
|
26
|
-
@values[i] = cycle("I", "just", "want", "to", "ride", name: "bikes")
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
it "should return a new value in the cycle order" do
|
31
|
-
assert_equal "I", @values[0]
|
32
|
-
assert_equal "just", @values[1]
|
33
|
-
assert_equal "want", @values[2]
|
34
|
-
assert_equal "to", @values[3]
|
35
|
-
assert_equal "ride", @values[4]
|
36
|
-
assert_equal "I", @values[0]
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
describe "with multiple instances in one loop" do
|
42
|
-
before do
|
43
|
-
@values = []
|
44
|
-
@sub_values = []
|
45
|
-
(0..3).each do |i|
|
46
|
-
@values[i] = cycle("Foo", "Bar", "Huh?")
|
47
|
-
|
48
|
-
value = []
|
49
|
-
(0..5).each do |j|
|
50
|
-
value[j] = cycle("I", "just", "want", "to", "ride", name: "bikes")
|
51
|
-
end
|
52
|
-
@sub_values[i] = value
|
53
|
-
|
54
|
-
reset_cycle("bikes")
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
58
|
-
it "should return a value from the first cycle order" do
|
59
|
-
assert_equal "Foo", @values[0]
|
60
|
-
assert_equal "Bar", @values[1]
|
61
|
-
assert_equal "Huh?", @values[2]
|
62
|
-
assert_equal "Foo", @values[3]
|
63
|
-
end
|
64
|
-
|
65
|
-
it "should return a value from the first bike cycle order" do
|
66
|
-
assert_equal "I", @sub_values[0][0]
|
67
|
-
assert_equal "just", @sub_values[0][1]
|
68
|
-
assert_equal "want", @sub_values[0][2]
|
69
|
-
assert_equal "to", @sub_values[0][3]
|
70
|
-
assert_equal "ride", @sub_values[0][4]
|
71
|
-
assert_equal "I", @sub_values[0][0]
|
72
|
-
end
|
73
|
-
|
74
|
-
it "should return a value from the second bike cycle order" do
|
75
|
-
assert_equal "I", @sub_values[1][0]
|
76
|
-
assert_equal "just", @sub_values[1][1]
|
77
|
-
assert_equal "want", @sub_values[1][2]
|
78
|
-
assert_equal "to", @sub_values[1][3]
|
79
|
-
assert_equal "ride", @sub_values[1][4]
|
80
|
-
assert_equal "I", @sub_values[1][0]
|
81
|
-
end
|
82
|
-
|
83
|
-
it "should return a value from the third bike cycle order" do
|
84
|
-
assert_equal "I", @sub_values[2][0]
|
85
|
-
assert_equal "just", @sub_values[2][1]
|
86
|
-
assert_equal "want", @sub_values[2][2]
|
87
|
-
assert_equal "to", @sub_values[2][3]
|
88
|
-
assert_equal "ride", @sub_values[2][4]
|
89
|
-
assert_equal "I", @sub_values[2][0]
|
90
|
-
end
|
91
|
-
end
|
92
|
-
|
93
|
-
describe "finding its current cycle" do
|
94
|
-
before do
|
95
|
-
@values = []
|
96
|
-
@current = []
|
97
|
-
(0..5).each do |i|
|
98
|
-
@values[i] = cycle("I", "just", "want", "to", "ride")
|
99
|
-
@current[i] = current_cycle
|
100
|
-
end
|
101
|
-
end
|
102
|
-
|
103
|
-
it "should match whats cycled" do
|
104
|
-
(0..5).each do |i|
|
105
|
-
assert_equal @values[i], @current[i]
|
106
|
-
end
|
107
|
-
end
|
108
|
-
end
|
109
|
-
end
|