kabal 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3cf4b9fcfb470eb18a488ba782bdacd664767a3a
4
- data.tar.gz: 8b6ad5bd552fdcb7cc42aff56039cac8991b85b4
3
+ metadata.gz: b54dc91c4b10e129d562e5c1c298655a7472d0e9
4
+ data.tar.gz: b223d38f34c12fd4dd854f87f5b2395088cc8678
5
5
  SHA512:
6
- metadata.gz: cf141f18e9a73bb9e03dd7998ca45c6855bb3259983b3a241b3d7c2bbaab86c67471144ac9a427df5501708589b9ba1de15ef498db08ad0e1828b87ea22d586a
7
- data.tar.gz: cdcf93b6454fe22751d380b30a02892c693457bb84a1bb5795d851c54b2ae65bd9a3e609cb5222437ef25509476b423fe01186b5882c6fe2cd2cb16b6e8c93cb
6
+ metadata.gz: 1355837b14a476cb0ed7dc81c1cbdbe9618be241893e2a2c2f12d325492141b2ead43c8e1d2087adbc608bcc3df3f47054395d097672ad3cc0ec815faa45823a
7
+ data.tar.gz: 5f08687ce36d79c16217ea87632059e0468ce660695fb9da92d3b66a05f7d200733445c2ca382f32f0020165538f025ca7b083570d982018ac8bc6db03d78e47
@@ -0,0 +1,6 @@
1
+ TConsole::Config.run do |config|
2
+ config.file_sets = {
3
+ "all" => ["test/**/*_test.rb"],
4
+ "bigtest" => ["test/lib/bigtest.rb"]
5
+ }
6
+ end
data/README.md CHANGED
@@ -28,11 +28,11 @@ Kabal has one main feature - number to text "converting".
28
28
  require 'kabal'
29
29
  include Kabal
30
30
  Kabal.to_text 1 #=> "один"
31
-
31
+
32
32
  You can choose language to "converting".
33
33
 
34
34
  Kabal.language = "Russian"
35
-
35
+
36
36
  Supported Languages:
37
37
 
38
38
  * Russian
@@ -56,3 +56,8 @@ To add Elfin language you should:
56
56
  3. Create `yaml/languages/el.yml`. You'll add numbers and words, which they correspond, there.
57
57
  4. Add `Elfin: "el"` to `yaml/languages.yml`.
58
58
  5. Add `require "kabal/languages/elfin"` to `lib/kabal/supported_languages.rb`.
59
+
60
+ ## Testing
61
+
62
+ Kabal has the BigTest. This test checks the correctness of the operation with all the numbers (0 to 10,000) in all supported languages.
63
+ Be careful: BigTest working with 10 001 numbers on one languages during around 3 minutes.
@@ -16,7 +16,7 @@ module Kabal
16
16
  end
17
17
 
18
18
  def language=(language_to_set)
19
- languages = YAML.load_file('yaml/languages.yml')
19
+ languages = YamlLoader.yaml_object "languages"
20
20
  if languages[language_to_set]
21
21
  @language = language_to_set
22
22
  else
@@ -25,7 +25,7 @@ module Kabal
25
25
  end
26
26
 
27
27
  def to_text_in_language(number, language_at_once)
28
- languages = YAML.load_file('yaml/languages.yml')
28
+ languages = YamlLoader.yaml_object "languages"
29
29
  if languages[language_at_once]
30
30
  obj = Object.const_get("Kabal::" + language_at_once).new
31
31
  obj.convert number
@@ -37,4 +37,9 @@ module Kabal
37
37
  def current_language
38
38
  @language
39
39
  end
40
+
41
+ def supported_languages
42
+ languages = YamlLoader.yaml_object "languages"
43
+ languages.keys
44
+ end
40
45
  end
@@ -1,3 +1,3 @@
1
1
  module Kabal
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
@@ -0,0 +1,14 @@
1
+ require "test_helper"
2
+
3
+ include Kabal
4
+
5
+ class BigTest < TestCase
6
+ def test_all_numbers_for_all_languages
7
+ Kabal.supported_languages.each do |lang|
8
+ Kabal.language = lang
9
+ (0..10 ** 4).each do |number|
10
+ assert Kabal.to_text number
11
+ end
12
+ end
13
+ end
14
+ end
@@ -31,4 +31,12 @@ class KabalTest < TestCase
31
31
  end
32
32
  assert_equal NoLanguageSupportError.message, exception.message
33
33
  end
34
+
35
+ def test_supported_languages
36
+ assert Kabal.supported_languages
37
+ end
38
+
39
+ def test_current_language
40
+ assert Kabal.current_language
41
+ end
34
42
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kabal
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Kalashnikov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-02 00:00:00.000000000 Z
11
+ date: 2014-05-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -47,6 +47,7 @@ extra_rdoc_files: []
47
47
  files:
48
48
  - ".coveralls.yml"
49
49
  - ".gitignore"
50
+ - ".tconsole"
50
51
  - ".travis.yml"
51
52
  - Gemfile
52
53
  - LICENSE.txt
@@ -64,6 +65,7 @@ files:
64
65
  - lib/kabal/languages/russian/declinations.rb
65
66
  - lib/kabal/supported_languages.rb
66
67
  - lib/kabal/version.rb
68
+ - test/lib/bigtest.rb
67
69
  - test/lib/kabal/languages/russian_test.rb
68
70
  - test/lib/kabal_test.rb
69
71
  - test/test_helper.rb
@@ -94,6 +96,7 @@ signing_key:
94
96
  specification_version: 4
95
97
  summary: Number To Text Helper
96
98
  test_files:
99
+ - test/lib/bigtest.rb
97
100
  - test/lib/kabal/languages/russian_test.rb
98
101
  - test/lib/kabal_test.rb
99
102
  - test/test_helper.rb