konami-fo 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +4 -0
- data/README.md +1 -1
- data/Rakefile +8 -0
- data/konami-fo.gemspec +2 -0
- data/lib/konami/version.rb +1 -1
- data/test/konami/fo_test.rb +55 -0
- data/test/minitest_helper.rb +16 -0
- metadata +35 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 389d7468cafd224b987a49811c936fa5ea06acfe
|
4
|
+
data.tar.gz: f872117043fff46e6d3bc2a881784bc8a7ec5e51
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9edba2060a11d5b2bada84351ac4f338a8317852379097339cfea370764cb1c300e12dd0620026f145c0ba655ed78c808a08ac133204d08ee6a4b083d5044f8f
|
7
|
+
data.tar.gz: fa193b2411eabab7ffd22c8ad6656aa1f02c82d56c538e7caa7cececcb3750a72d6d1db5c937313dff0eb5e82be59164a3ba5129204cf6a2b4d8d23eb95a0fd5
|
data/.travis.yml
ADDED
data/README.md
CHANGED
data/Rakefile
CHANGED
data/konami-fo.gemspec
CHANGED
@@ -23,5 +23,7 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.add_runtime_dependency "konamio"
|
24
24
|
spec.add_runtime_dependency "foaas"
|
25
25
|
spec.add_development_dependency "rake"
|
26
|
+
spec.add_development_dependency "coveralls"
|
27
|
+
spec.add_development_dependency "minitest"
|
26
28
|
spec.add_development_dependency "pry"
|
27
29
|
end
|
data/lib/konami/version.rb
CHANGED
@@ -0,0 +1,55 @@
|
|
1
|
+
require "minitest_helper"
|
2
|
+
|
3
|
+
describe Konami::Fo do
|
4
|
+
before do
|
5
|
+
@subject = Konami::Fo
|
6
|
+
@konamio_params = {
|
7
|
+
input: @input = MiniTest::Mock.new,
|
8
|
+
output: @output = MiniTest::Mock.new,
|
9
|
+
prompt: @prompt = "Foo diddly doobardy party hardy",
|
10
|
+
listener: @listener = MiniTest::Mock.new,
|
11
|
+
speaker: @speaker = MiniTest::Mock.new,
|
12
|
+
sequence: @sequence = ["a"],
|
13
|
+
confirmation: @confirmation = "Good job, you."
|
14
|
+
}
|
15
|
+
|
16
|
+
@speaker_instance = MiniTest::Mock.new
|
17
|
+
@speaker_result = MiniTest::Mock.new
|
18
|
+
@speaker_instance.expect(:execute!, @speaker_result)
|
19
|
+
@speaker_instance.expect(:execute!, @speaker_result)
|
20
|
+
|
21
|
+
@listener_instance = MiniTest::Mock.new
|
22
|
+
@listener_result = MiniTest::Mock.new
|
23
|
+
@listener_instance.expect(:execute!, @listener_result)
|
24
|
+
@listener_instance.expect(:execute!, @listener_result)
|
25
|
+
|
26
|
+
@speaker.expect(:new, @speaker_instance, [{ prompt: @prompt, output: @output }])
|
27
|
+
@listener.expect(:new, @listener_instance, [{ sequence: @sequence, input: @input }])
|
28
|
+
@data_hash = MiniTest::Mock.new
|
29
|
+
@listener_result.expect(:data, @data_hash)
|
30
|
+
@data_hash.expect(:[], ["a"], [:sequence])
|
31
|
+
|
32
|
+
@speaker.expect(:new, @speaker_instance, [{ prompt: @prompt, output: @output }])
|
33
|
+
@listener.expect(:new, @listener_instance, [{ sequence: @sequence, input: @input }])
|
34
|
+
@data_hash = MiniTest::Mock.new
|
35
|
+
@listener_result.expect(:data, @data_hash)
|
36
|
+
@data_hash.expect(:[], [], [:sequence])
|
37
|
+
|
38
|
+
@speaker_confirmation_instance = MiniTest::Mock.new
|
39
|
+
@speaker_confirmation_result = MiniTest::Mock.new
|
40
|
+
@speaker.expect(:new, @speaker_confirmation_instance, [{ prompt: @confirmation, output: @output }])
|
41
|
+
@speaker_confirmation_instance.expect(:execute!, @speaker_confirmation_result)
|
42
|
+
end
|
43
|
+
|
44
|
+
it "can be initialized" do
|
45
|
+
@subject.must_respond_to :new
|
46
|
+
end
|
47
|
+
|
48
|
+
it "can be initialized without arguments" do
|
49
|
+
@subject.new().must_respond_to :execute!
|
50
|
+
end
|
51
|
+
|
52
|
+
it "must return a result object" do
|
53
|
+
assert @subject.new(konamio_params: @konamio_params).execute!.successful?
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# Testing frameworks
|
2
|
+
require 'coveralls'
|
3
|
+
Coveralls.wear!
|
4
|
+
#require 'simplecov'
|
5
|
+
#SimpleCov.start
|
6
|
+
|
7
|
+
require "minitest/autorun"
|
8
|
+
|
9
|
+
# Debugger
|
10
|
+
require "pry"
|
11
|
+
|
12
|
+
# The gem
|
13
|
+
$: << File.dirname(__FILE__) + "/../lib"
|
14
|
+
$: << File.dirname(__FILE__)
|
15
|
+
|
16
|
+
require "konami/fo"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: konami-fo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan T. Hosford
|
@@ -80,6 +80,34 @@ dependencies:
|
|
80
80
|
- - '>='
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: coveralls
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - '>='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - '>='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: minitest
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - '>='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
83
111
|
- !ruby/object:Gem::Dependency
|
84
112
|
name: pry
|
85
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -102,6 +130,7 @@ extensions: []
|
|
102
130
|
extra_rdoc_files: []
|
103
131
|
files:
|
104
132
|
- .gitignore
|
133
|
+
- .travis.yml
|
105
134
|
- Gemfile
|
106
135
|
- LICENSE.txt
|
107
136
|
- README.md
|
@@ -109,6 +138,8 @@ files:
|
|
109
138
|
- konami-fo.gemspec
|
110
139
|
- lib/konami/fo.rb
|
111
140
|
- lib/konami/version.rb
|
141
|
+
- test/konami/fo_test.rb
|
142
|
+
- test/minitest_helper.rb
|
112
143
|
homepage: ''
|
113
144
|
licenses:
|
114
145
|
- MIT
|
@@ -133,4 +164,6 @@ rubygems_version: 2.0.3
|
|
133
164
|
signing_key:
|
134
165
|
specification_version: 4
|
135
166
|
summary: Enter the Konami code and 'eff off promptly.
|
136
|
-
test_files:
|
167
|
+
test_files:
|
168
|
+
- test/konami/fo_test.rb
|
169
|
+
- test/minitest_helper.rb
|