steam_hlds_log_parser 0.4.4 → 0.4.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/steam_hlds_log_parser/version.rb +1 -1
- data/spec/client_spec.rb +1 -1
- data/spec/handler_spec.rb +10 -4
- data/spec/helper_spec.rb +10 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a32a52ce679e252af994eedb84a7d2781ebffb95
|
4
|
+
data.tar.gz: f07dfa6ca9605ae974f034f237f25357eac3c7d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 92fe4262801a3671c38291873f677634b13cf7047c6fd5096ac31ba451d1f3b51502996eaa5d3e78ebd51e0a36e9f751bd4fbe2d799ba14e694a57f5a9bd7318
|
7
|
+
data.tar.gz: 8fd46eefe9a61187958f683eb8d7051a7263a3e1f0847cfe4d1f42764f29f853e59d22854c8c9abe8060263588480b27754766f59173139311890a407c967e86
|
data/spec/client_spec.rb
CHANGED
@@ -45,7 +45,7 @@ module SteamHldsLogParser
|
|
45
45
|
@custom_client.options[:locale].should be(:fr)
|
46
46
|
@custom_client.options[:display_kills].should be(false)
|
47
47
|
@custom_client.options[:display_actions].should be(false)
|
48
|
-
@custom_client.options[:display_changelevel].should be(
|
48
|
+
@custom_client.options[:display_changelevel].should be(true)
|
49
49
|
end
|
50
50
|
|
51
51
|
describe "#start and #stop" do
|
data/spec/handler_spec.rb
CHANGED
@@ -8,6 +8,7 @@ module SteamHldsLogParser
|
|
8
8
|
@client = Client.new("0.0.0.0", 27035)
|
9
9
|
@options = @client.options
|
10
10
|
@handler = Handler.new("", "0.0.0.0", 27035, @options)
|
11
|
+
@custom_handler = Handler.new("", "0.0.0.0", 27035, custom_options)
|
11
12
|
end
|
12
13
|
|
13
14
|
describe "Handler" do
|
@@ -134,26 +135,31 @@ module SteamHldsLogParser
|
|
134
135
|
end
|
135
136
|
end
|
136
137
|
|
138
|
+
context "when 'displayer' is set" do
|
139
|
+
it "returns Hash on changelevel provided by 'displayer'" do
|
140
|
+
data = '# L 05/10/2000 - 12:34:56: Loading map "de_dust2"'
|
141
|
+
expected = {:type=>"loading_map", :params=>{:map=>"de_dust2"}}
|
142
|
+
@custom_handler.options[:displayer].should eq(RSpecDisplayer)
|
143
|
+
@custom_handler.receive_data(data).data.should eq(expected)
|
144
|
+
end
|
145
|
+
end
|
146
|
+
|
137
147
|
end
|
138
148
|
|
139
149
|
describe "#get_full_team_name" do
|
140
|
-
|
141
150
|
context "when short name is given"
|
142
151
|
it "returns full name" do
|
143
152
|
@handler.get_full_team_name("T").should eq("Terrorist")
|
144
153
|
@handler.get_full_team_name("CT").should eq("Counter-Terrorist")
|
145
154
|
end
|
146
|
-
|
147
155
|
end
|
148
156
|
|
149
157
|
describe "#get_short_team_name" do
|
150
|
-
|
151
158
|
context "when full name is given"
|
152
159
|
it "returns short name" do
|
153
160
|
@handler.get_short_team_name("TERRORIST").should eq("T")
|
154
161
|
@handler.get_short_team_name("CT").should eq("CT")
|
155
162
|
end
|
156
|
-
|
157
163
|
end
|
158
164
|
|
159
165
|
end
|
data/spec/helper_spec.rb
CHANGED
@@ -3,9 +3,12 @@ require "coveralls"
|
|
3
3
|
require "rspec"
|
4
4
|
|
5
5
|
# Simplecov / Coverall configuration
|
6
|
-
SimpleCov.formatter =
|
6
|
+
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
|
7
|
+
SimpleCov::Formatter::HTMLFormatter,
|
8
|
+
Coveralls::SimpleCov::Formatter
|
9
|
+
]
|
7
10
|
SimpleCov.start do
|
8
|
-
add_filter "/
|
11
|
+
add_filter "/examples/"
|
9
12
|
add_filter "/spec/"
|
10
13
|
end
|
11
14
|
|
@@ -23,6 +26,10 @@ def capture_stdout(&block)
|
|
23
26
|
end
|
24
27
|
|
25
28
|
class RSpecDisplayer
|
29
|
+
attr_reader :data
|
30
|
+
def initialize(data)
|
31
|
+
@data = data
|
32
|
+
end
|
26
33
|
end
|
27
34
|
|
28
35
|
require "steam_hlds_log_parser"
|
@@ -33,7 +40,7 @@ def custom_options
|
|
33
40
|
:locale => :fr,
|
34
41
|
:display_kills => false,
|
35
42
|
:display_actions => false,
|
36
|
-
:display_changelevel =>
|
43
|
+
:display_changelevel => true,
|
37
44
|
:displayer => RSpecDisplayer
|
38
45
|
}
|
39
46
|
end
|