kowabana-parser 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 11f97b601cdb9981e8744eb39528108292e9f206
4
- data.tar.gz: 2f5cfbff7cf0ee020294ae966b2eeb32524d5548
3
+ metadata.gz: 992e2295107b371325d7880b3ddfe1c3012aa853
4
+ data.tar.gz: 8bec4921355fcb080ded5aabb56a45f0cb21deb8
5
5
  SHA512:
6
- metadata.gz: 71d890890c6e22ccaeb724e28c8140eed18b20b6ff1256c393df05f80af702615e3478adf75e548f9bd1f99fe230ec905439c1316e34865db7cb171418c7ef23
7
- data.tar.gz: 337d17e7419fbb8e30698a6c10c42ea458c88e327f578f2cc4c59dc26c776090e65deda488e702bee455f88d87b2c5d482dc030a988777c273e505a9e8a90293
6
+ metadata.gz: 86a903d4436253f1a908308bce82aaa8008f9935fa66c980cb31a3ff6ae43f225c6d7e0cd238f59e210f72a551907ef6881892013ce116b83b63efdf55440ffc
7
+ data.tar.gz: d6cdfa742195657b8a58dd42572eccdfe0b7f6d251a4da807a5b2872203f11fe15e8055f152ebef271d5c9962b67b57807ec67f694e9cd5848adf36c02bc2c6d
@@ -31,6 +31,10 @@ module Kowabana
31
31
  @plain_texts << line
32
32
  end
33
33
  end
34
+
35
+ @wallpaper_ids.uniq!
36
+ @music_ids.uniq!
37
+ @sound_ids.uniq!
34
38
  end
35
39
 
36
40
  private
@@ -1,5 +1,5 @@
1
1
  module Kowabana
2
2
  class Parser
3
- VERSION = '0.1.0'
3
+ VERSION = '0.1.1'
4
4
  end
5
5
  end
@@ -1,7 +1,6 @@
1
1
  # encoding: utf-8
2
2
  require 'test/unit'
3
3
  require_relative '../lib/kowabana/parser'
4
- require 'pry-byebug'
5
4
 
6
5
  class TestKowabanaParser < Test::Unit::TestCase
7
6
  def setup
@@ -32,7 +31,7 @@ dddddddddddd
32
31
  end
33
32
 
34
33
  def test_command_parse!
35
- @parser.text = <<-EOS2
34
+ @parser.text = <<-EOS
36
35
  music:1
37
36
  aaaaaaaaaaaa
38
37
  wallpaper:1
@@ -45,7 +44,7 @@ nextpage
45
44
  wallpaper:4
46
45
  bbbbbbbbbbbb
47
46
  sound:3
48
- EOS2
47
+ EOS
49
48
  @parser.parse!
50
49
  assert { [1, 2, 4] == @parser.wallpaper_ids }
51
50
  assert { [1, 3] == @parser.music_ids }
@@ -56,4 +55,37 @@ sound:3
56
55
  ]
57
56
  assert { plain == @parser.plain_texts }
58
57
  end
58
+
59
+ def test_redundant_wallpaper_id
60
+ @parser.text = <<-EOS
61
+ wallpaper:1
62
+ wallpaper:1
63
+ wallpaper:2
64
+ wallpaper:4
65
+ EOS
66
+ @parser.parse!
67
+ assert { [1, 2, 4] == @parser.wallpaper_ids }
68
+ end
69
+
70
+ def test_redundant_music_id
71
+ @parser.text = <<-EOS
72
+ music:1
73
+ music:2
74
+ music:2
75
+ music:4
76
+ EOS
77
+ @parser.parse!
78
+ assert { [1, 2, 4] == @parser.music_ids }
79
+ end
80
+
81
+ def test_redundant_sound_id
82
+ @parser.text = <<-EOS
83
+ sound:1
84
+ sound:2
85
+ sound:4
86
+ sound:4
87
+ EOS
88
+ @parser.parse!
89
+ assert { [1, 2, 4] == @parser.sound_ids }
90
+ end
59
91
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kowabana-parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masaki Komagata