runoff 0.3.0 → 0.3.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 +4 -4
- data/README.md +1 -2
- data/lib/runoff/location.rb +29 -0
- data/lib/runoff/version.rb +1 -1
- data/test/all_test.rb +26 -14
- data/test/chat_test.rb +6 -4
- data/test/command_test.rb +26 -14
- data/test/composition_test.rb +26 -21
- data/test/file_writer_test.rb +52 -42
- data/test/location_test.rb +14 -10
- data/test/skype_data_format_test.rb +20 -19
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2cbece2f0614ed17f5c62f98227f7c000e3b7985
|
4
|
+
data.tar.gz: f10c4978d07c72e9e004d7bbdb9647c54f36bc32
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b086d0b09ba49f49d81a376d7c4c0f8c56aa2f9f6f4ecc04851046129f53567ae07a70adb05b48bc8342f5cbc921f65c88b275f893fb05d385fd02db8c0f6bb3
|
7
|
+
data.tar.gz: 9b149cab21193959a02575b6ad5111a63b9b71e80e21817cc5ad7dace585db70018f12f9131511d42b15f13b8083a34239566c502ae3d155bf342ab0a42edc22
|
data/README.md
CHANGED
@@ -26,7 +26,7 @@ To export specific chats.
|
|
26
26
|
|
27
27
|
runoff chat skype_username
|
28
28
|
|
29
|
-
If you don't want to put files into an archive, use
|
29
|
+
If you don't want to put files into an archive, use `-a` option
|
30
30
|
|
31
31
|
runoff all skype_username -a false
|
32
32
|
|
@@ -34,7 +34,6 @@ If you don't want to put files into an archive, use `--no-archive` option
|
|
34
34
|
|
35
35
|
Things to do in the future versions:
|
36
36
|
|
37
|
-
- Refactore tests (move from MiniTest::Spec to MiniTest::Unit).
|
38
37
|
- Parse body_xml to filter XML tags and character entities.
|
39
38
|
- Append only new messages to the previously genetrated files instead of appending everything or create different versions for the files when using `-a false` option.
|
40
39
|
- Add some colors.
|
data/lib/runoff/location.rb
CHANGED
@@ -28,6 +28,10 @@ module Runoff
|
|
28
28
|
if RbConfig::CONFIG['host_os'] =~ /mingw/
|
29
29
|
location = "#{ENV['APPDATA']}\\Skype\\#{skype_username}\\main.db"
|
30
30
|
|
31
|
+
unless File.exist?("#{ENV['APPDATA']}\\Skype")
|
32
|
+
location = self.get_default_skype_data_location_on_windows_8 skype_username
|
33
|
+
end
|
34
|
+
|
31
35
|
location.gsub!(/\\/, '/')
|
32
36
|
location.gsub(/^[a-zA-Z]:/, '')
|
33
37
|
elsif RbConfig::CONFIG['host_os'] =~ /linux/
|
@@ -36,5 +40,30 @@ module Runoff
|
|
36
40
|
"#{ENV['HOME']}/Library/Application Support/Skype/#{skype_username}/main.db"
|
37
41
|
end
|
38
42
|
end
|
43
|
+
|
44
|
+
private
|
45
|
+
|
46
|
+
# Public: Composes the default Skype database location for the Windows 8 operating system.
|
47
|
+
#
|
48
|
+
# skype_username - A String that contains a username of the Skype account,
|
49
|
+
# which database we want to access.
|
50
|
+
#
|
51
|
+
# Examples
|
52
|
+
#
|
53
|
+
# get_default_skype_data_location_on_windows_8 skype_username
|
54
|
+
# # => C:/Users/user/AppData/Local/Packages/Microsoft.SkypeApp_sakjhds8asd/LocalState/skype_username/main.db
|
55
|
+
#
|
56
|
+
# Returns a String that contains the path to the Skype database file.
|
57
|
+
def self.get_default_skype_data_location_on_windows_8(skype_username)
|
58
|
+
location = "#{ENV['HOME']}/AppData/Local/Packages"
|
59
|
+
|
60
|
+
Dir["#{location}/*"].each do |item|
|
61
|
+
if item =~ /Microsoft\.SkypeApp/
|
62
|
+
location = "#{item}/LocalState/#{skype_username}/main.db"
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
location
|
67
|
+
end
|
39
68
|
end
|
40
69
|
end
|
data/lib/runoff/version.rb
CHANGED
data/test/all_test.rb
CHANGED
@@ -1,25 +1,37 @@
|
|
1
|
-
require 'minitest/spec'
|
2
1
|
require 'minitest/autorun'
|
2
|
+
require 'minitest/unit'
|
3
3
|
require 'runoff'
|
4
|
+
require 'fileutils'
|
4
5
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
class TestAll < MiniTest::Test
|
7
|
+
def teardown
|
8
|
+
Dir.glob('test/*.zip').each do |archive|
|
9
|
+
File.delete archive
|
10
|
+
end
|
9
11
|
|
10
|
-
|
11
|
-
->{ Runoff::Commands::All.process [], {
|
12
|
-
from: 'test/test_db.sqlite', destination: 'test/tmp' }
|
13
|
-
}.must_output "Finished: 2 files were exported\n"
|
12
|
+
FileUtils.rm_rf 'test/tmp'
|
14
13
|
end
|
15
14
|
|
16
|
-
|
17
|
-
|
15
|
+
def test_must_output_an_error_message_if_no_username_or_from_option_is_provided
|
16
|
+
assert_output "You must specify a username or a --from option\n" do
|
17
|
+
Runoff::Commands::All.process []
|
18
|
+
end
|
19
|
+
end
|
18
20
|
|
19
|
-
|
21
|
+
def test_must_output_result_of_the_command
|
22
|
+
assert_output "Finished: 2 files were exported\n" do
|
23
|
+
Runoff::Commands::All.process [], {
|
24
|
+
from: 'test/test_db.sqlite',
|
25
|
+
destination: 'test/tmp'
|
26
|
+
}
|
27
|
+
end
|
28
|
+
end
|
20
29
|
|
21
|
-
|
22
|
-
|
30
|
+
def test_must_put_exported_files_into_an_archive
|
31
|
+
capture_io do
|
32
|
+
Runoff::Commands::All.process [], { from: 'test/test_db.sqlite', destination: 'test/tmp' }
|
23
33
|
end
|
34
|
+
|
35
|
+
assert_equal 1, Dir["test/*.zip"].length, "test directory must contain 1 Zip file"
|
24
36
|
end
|
25
37
|
end
|
data/test/chat_test.rb
CHANGED
@@ -1,9 +1,11 @@
|
|
1
|
-
require 'minitest/spec'
|
2
1
|
require 'minitest/autorun'
|
2
|
+
require 'minitest/unit'
|
3
3
|
require 'runoff'
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
class TestChat < MiniTest::Test
|
6
|
+
def test_must_output_an_error_message_if_no_username_or_from_option_is_procided
|
7
|
+
assert_output "You must specify a username or a --from option\n" do
|
8
|
+
Runoff::Commands::Chat.process []
|
9
|
+
end
|
8
10
|
end
|
9
11
|
end
|
data/test/command_test.rb
CHANGED
@@ -1,29 +1,41 @@
|
|
1
|
-
require 'minitest/spec'
|
2
1
|
require 'minitest/autorun'
|
2
|
+
require 'minitest/unit'
|
3
3
|
require 'runoff'
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
Runoff::Commands::Command.send(:get_composition, nil, 'test/test_db.sqlite')
|
5
|
+
class TestCommand < MiniTest::Test
|
6
|
+
def test_must_create_a_composition_object_based_on_a_specified_path_to_database_file
|
7
|
+
assert_instance_of Runoff::Composition, Runoff::Commands::Command.send(:get_composition, nil, 'test/test_db.sqlite')
|
8
8
|
end
|
9
9
|
|
10
|
-
|
11
|
-
|
10
|
+
def test_must_return_a_default_destination_path_if_no_optional_path_is_specified
|
11
|
+
assert_equal "#{ENV['HOME']}/skype-backup", Runoff::Commands::Command.send(:get_destination, nil)
|
12
12
|
end
|
13
13
|
|
14
|
-
|
15
|
-
path = Runoff::Commands::Command.send
|
16
|
-
|
14
|
+
def test_must_return_a_custom_path_if_an_optional_path_is_specified
|
15
|
+
path = Runoff::Commands::Command.send :get_destination, 'test/test_db.sqlite'
|
16
|
+
|
17
|
+
assert_equal 'test/test_db.sqlite', path
|
17
18
|
end
|
18
19
|
|
19
|
-
|
20
|
-
|
21
|
-
|
20
|
+
def test_must_output_correct_message_based_on_the_exported_items_count
|
21
|
+
assert_output "Finished: 1 file was exported\n" do
|
22
|
+
Runoff::Commands::Command.send :print_result, 1
|
23
|
+
end
|
24
|
+
|
25
|
+
assert_output "Finished: 2 files were exported\n" do
|
26
|
+
Runoff::Commands::Command.send :print_result, 2
|
27
|
+
end
|
22
28
|
end
|
23
29
|
|
24
|
-
|
30
|
+
def test_must_output_a_list_of_available_chatnames
|
25
31
|
chatnames = ['first-chatname', 'second-chatname']
|
26
32
|
|
27
|
-
|
33
|
+
assert_output "[0] first-chatname\n[1] second-chatname\n\n" do
|
34
|
+
Runoff::Commands::Command.send :list_chatnames, chatnames
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
def test_does_not_create_an_archive_if_the_archive_option_is_set_to_false
|
39
|
+
skip
|
28
40
|
end
|
29
41
|
end
|
data/test/composition_test.rb
CHANGED
@@ -1,53 +1,58 @@
|
|
1
|
-
require 'minitest/spec'
|
2
1
|
require 'minitest/autorun'
|
2
|
+
require 'minitest/unit'
|
3
3
|
require 'runoff'
|
4
4
|
require 'fileutils'
|
5
5
|
|
6
|
-
|
7
|
-
|
6
|
+
class TestComposition < MiniTest::Test
|
7
|
+
def setup
|
8
|
+
@composition = Runoff::Composition.new 'test/test_db.sqlite'
|
9
|
+
end
|
10
|
+
|
11
|
+
def teardown
|
12
|
+
FileUtils.rm_rf 'test/tmp'
|
13
|
+
end
|
8
14
|
|
9
|
-
|
10
|
-
|
15
|
+
def test_must_raise_an_IOError_if_the_file_that_is_passed_to_the_constructor_does_not_exist
|
16
|
+
assert_raises IOError do
|
17
|
+
composition = Runoff::Composition.new 'not_existing.db'
|
18
|
+
end
|
11
19
|
end
|
12
20
|
|
13
|
-
|
14
|
-
@composition
|
21
|
+
def test_must_respond_to_exported_filenames_method
|
22
|
+
assert_respond_to @composition, :exported_filenames
|
15
23
|
end
|
16
24
|
|
17
|
-
|
25
|
+
def test_must_return_parsed_chatnames_together_with_partly_parsed_chatnames
|
18
26
|
chatnames, raw_chatnames = @composition.get_chatnames
|
19
27
|
|
20
|
-
|
21
|
-
|
28
|
+
assert_equal ['something-more', 'something-else'], chatnames
|
29
|
+
assert_equal ['#something/$more;', '#something/$else;'], raw_chatnames
|
22
30
|
end
|
23
31
|
|
24
|
-
|
32
|
+
def test_must_return_a_count_of_the_exported_filenames
|
25
33
|
file_count = @composition.send(
|
26
34
|
:run_export,
|
27
35
|
[{
|
28
|
-
chatname: '#
|
36
|
+
chatname: '#john/$elis;7687623',
|
29
37
|
timestamp: 123123213,
|
30
|
-
from_dispname: '
|
38
|
+
from_dispname: 'John',
|
31
39
|
body_xml: ''
|
32
40
|
}],
|
33
41
|
'test/tmp'
|
34
42
|
)
|
35
43
|
|
36
|
-
|
37
|
-
FileUtils.rm_rf 'test/tmp'
|
44
|
+
assert_equal 1, file_count
|
38
45
|
end
|
39
46
|
|
40
|
-
|
47
|
+
def test_must_return_a_count_of_the_exported_filenames_when_called_for_all_chats
|
41
48
|
file_count = @composition.export 'test/tmp'
|
42
49
|
|
43
|
-
|
44
|
-
FileUtils.rm_rf 'test/tmp'
|
50
|
+
assert_equal 2, file_count
|
45
51
|
end
|
46
52
|
|
47
|
-
|
53
|
+
def test_must_return_a_count_of_the_exported_filenames_when_called_for_specific_chats
|
48
54
|
file_count = @composition.export_chats ['#something/$more;', '#something/$else;'], 'test/tmp'
|
49
55
|
|
50
|
-
|
51
|
-
FileUtils.rm_rf 'test/tmp'
|
56
|
+
assert_equal 2, file_count
|
52
57
|
end
|
53
58
|
end
|
data/test/file_writer_test.rb
CHANGED
@@ -1,80 +1,90 @@
|
|
1
|
+
require 'minitest/autorun'
|
1
2
|
require 'minitest/unit'
|
2
3
|
require 'runoff'
|
3
4
|
require 'fileutils'
|
4
5
|
|
5
|
-
|
6
|
-
|
6
|
+
class TestFileWriter < MiniTest::Test
|
7
|
+
def setup
|
7
8
|
@incorrect_chat_record = {
|
8
9
|
chatname: '#john/$;521357125362',
|
9
10
|
timestamp: 1366280218,
|
10
|
-
from_dispname: '
|
11
|
+
from_dispname: 'John',
|
11
12
|
body_xml: 'This is a text'
|
12
13
|
}
|
13
14
|
|
14
15
|
@chat_record = {
|
15
16
|
chatname: '#braun/$drake;521357125362',
|
16
17
|
timestamp: 1366280218,
|
17
|
-
from_dispname: '
|
18
|
+
from_dispname: 'Braun',
|
18
19
|
body_xml: 'This is a text.'
|
19
20
|
}
|
20
21
|
|
21
|
-
correct_format =
|
22
|
-
|
23
|
-
correct_format.expect :get_filename, 'something-more', [Hash]
|
24
|
-
correct_format.expect :get_filename, 'something-more', [Hash]
|
25
|
-
correct_format.expect :build_entry, '[2013-04-18 13:16:58] Aidzis: This is a text.', [Hash]
|
26
|
-
correct_format.expect :build_entry, '[2013-04-18 13:16:58] Aidzis: This is a text.', [Hash]
|
27
|
-
|
22
|
+
correct_format = get_correct_format_mock
|
28
23
|
@correct_file_writer = Runoff::FileWriter.new correct_format
|
29
|
-
|
30
|
-
incorrect_format = MiniTest::Mock.new
|
31
|
-
|
32
|
-
incorrect_format.expect :get_filename, 'something', [Hash]
|
33
|
-
incorrect_format.expect :build_entry, '[2013-04-18 13:16:58] Aidzis: This is a text.', [Hash]
|
34
|
-
|
24
|
+
incorrect_format = get_incorrect_format_mock
|
35
25
|
@incorrect_file_writer = Runoff::FileWriter.new incorrect_format
|
36
26
|
end
|
37
27
|
|
38
|
-
|
39
|
-
|
40
|
-
FileUtils.rm_rf 'test/tmp'
|
41
|
-
Dir.glob('test/*.zip').each do |archive|
|
42
|
-
File.delete archive
|
43
|
-
end
|
44
|
-
end
|
28
|
+
def teardown
|
29
|
+
FileUtils.rm_rf 'test/tmp'
|
45
30
|
|
46
|
-
|
47
|
-
|
48
|
-
@incorrect_file_writer.save_to_file @incorrect_chat_record, 'test/tmp'
|
49
|
-
Dir.glob('test/tmp/*.txt').count.must_equal 2
|
31
|
+
Dir.glob('test/*.zip').each do |archive|
|
32
|
+
File.delete archive
|
50
33
|
end
|
34
|
+
end
|
51
35
|
|
52
|
-
|
53
|
-
|
36
|
+
def test_must_write_chat_content_to_file
|
37
|
+
@correct_file_writer.save_to_file @chat_record, 'test/tmp'
|
38
|
+
@incorrect_file_writer.save_to_file @incorrect_chat_record, 'test/tmp'
|
54
39
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
40
|
+
assert_equal 2, Dir['test/tmp/*.txt'].count
|
41
|
+
end
|
42
|
+
|
43
|
+
def test_must_append_to_a_file_if_the_filename_already_exists
|
44
|
+
@additional_chat_record = @chat_record
|
45
|
+
|
46
|
+
@correct_file_writer.save_to_file @chat_record, 'test/tmp'
|
47
|
+
@incorrect_file_writer.save_to_file @incorrect_chat_record, 'test/tmp'
|
48
|
+
@correct_file_writer.save_to_file @additional_chat_record, 'test/tmp'
|
49
|
+
|
50
|
+
assert_equal 2, Dir['test/tmp/*.txt'].count
|
60
51
|
end
|
61
52
|
|
62
|
-
|
53
|
+
def test_must_create_a_zip_file_of_the_destination_directory
|
63
54
|
output_directory = 'test/tmp'
|
64
55
|
files = %w[first.txt second.txt]
|
65
56
|
|
66
57
|
Dir.mkdir(output_directory) unless File.exists?(output_directory)
|
58
|
+
|
67
59
|
files.each do |filename|
|
68
|
-
File.new "#{output_directory}/#{filename}", 'w'
|
60
|
+
file = File.new "#{output_directory}/#{filename}", 'w'
|
61
|
+
file.close
|
69
62
|
end
|
70
63
|
|
71
64
|
Runoff::FileWriter.archive output_directory
|
72
|
-
Dir["test/*.zip"].length.must_equal 1
|
73
65
|
|
74
|
-
Dir
|
75
|
-
|
76
|
-
end
|
66
|
+
assert_equal 1, Dir['test/*.zip'].count
|
67
|
+
end
|
77
68
|
|
78
|
-
|
69
|
+
private
|
70
|
+
|
71
|
+
def get_correct_format_mock
|
72
|
+
correct_format = MiniTest::Mock.new
|
73
|
+
|
74
|
+
correct_format.expect :get_filename, 'braun-drake.txt', [Hash]
|
75
|
+
correct_format.expect :get_filename, 'braun-drake.txt', [Hash]
|
76
|
+
correct_format.expect :build_entry, '[2013-04-18 13:16:58] Braun: This is a text.', [Hash]
|
77
|
+
correct_format.expect :build_entry, '[2013-04-18 13:16:58] Braun: This is a text.', [Hash]
|
78
|
+
|
79
|
+
correct_format
|
80
|
+
end
|
81
|
+
|
82
|
+
def get_incorrect_format_mock
|
83
|
+
incorrect_format = MiniTest::Mock.new
|
84
|
+
|
85
|
+
incorrect_format.expect :get_filename, 'john.txt', [Hash]
|
86
|
+
incorrect_format.expect :build_entry, '[2013-04-18 13:16:58] John: This is a text.', [Hash]
|
87
|
+
|
88
|
+
incorrect_format
|
79
89
|
end
|
80
90
|
end
|
data/test/location_test.rb
CHANGED
@@ -1,19 +1,23 @@
|
|
1
|
-
require 'minitest/spec'
|
2
1
|
require 'minitest/autorun'
|
2
|
+
require 'minitest/unit'
|
3
3
|
require 'runoff'
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
5
|
+
class TestLocation < MiniTest::Test
|
6
|
+
def setup
|
7
|
+
@path = Runoff::Location.default_skype_data_location 'aidzis_skype'
|
8
|
+
end
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
10
|
+
def test_must_return_a_default_path_depending_on_the_operating_system
|
11
|
+
if RbConfig::CONFIG['host_os'] =~ /mingw/
|
12
|
+
if File.exist?("#{ENV['APPDATA']}\\Skype")
|
13
|
+
assert_match /\/Users\/[a-zA-Z0-9]+\/AppData\/Roaming\/Skype\/aidzis_skype\/main\.db/, @path
|
14
14
|
else
|
15
|
-
|
15
|
+
assert_match /\/Users\/[a-zA-Z0-9]+\/AppData\/Local\/Packages\/[a-zA-Z0-9_\/\.]+\/aidzis_skype\/main\.db/, @path
|
16
16
|
end
|
17
|
+
elsif RbConfig::CONFIG['host_os'] =~ /linux/
|
18
|
+
assert_match /\/home\/[a-zA-Z0-9]+\/\.Skype\/aidzis_skype\/main\.db/, @path
|
19
|
+
else
|
20
|
+
assert_match /~\/Library\/Application Support\/Skype\/aidzis_skype\/main\.db/, @path
|
17
21
|
end
|
18
22
|
end
|
19
23
|
end
|
@@ -1,70 +1,71 @@
|
|
1
|
-
require 'minitest/spec'
|
2
1
|
require 'minitest/autorun'
|
2
|
+
require 'minitest/unit'
|
3
3
|
require 'runoff'
|
4
4
|
|
5
|
-
|
6
|
-
|
5
|
+
class TestSkypeDataFormat < MiniTest::Test
|
6
|
+
def setup
|
7
7
|
@format = Runoff::SkypeDataFormat.new
|
8
8
|
end
|
9
9
|
|
10
|
-
|
10
|
+
def test_must_return_a_valid_filename_from_a_hash
|
11
11
|
record = { chatname: '#brian/$john;521357125362' }
|
12
12
|
filename = @format.get_filename record
|
13
13
|
|
14
|
-
|
14
|
+
assert_equal 'brian-john.txt', filename
|
15
15
|
end
|
16
16
|
|
17
|
-
|
17
|
+
def test_must_build_a_string_from_the_necessary_database_record_columns
|
18
18
|
record = {
|
19
19
|
chatname: '#brian/$john;521357125362',
|
20
20
|
timestamp: 1366280218,
|
21
21
|
from_dispname: 'Aidzis',
|
22
22
|
body_xml: 'This is a text.'
|
23
23
|
}
|
24
|
+
|
24
25
|
entry = @format.build_entry record
|
25
26
|
|
26
|
-
|
27
|
+
assert_equal '[2013-04-18 13:16:58] Aidzis: This is a text.', entry
|
27
28
|
end
|
28
29
|
|
29
|
-
|
30
|
+
def test_must_return_a_valid_and_readable_name_from_a_raw_chatname
|
30
31
|
raw_chatname = '#something/$else;521357125362'
|
31
32
|
chatname = @format.parse_chatname raw_chatname
|
32
33
|
|
33
|
-
|
34
|
+
assert_equal 'something-else', chatname
|
34
35
|
end
|
35
36
|
|
36
|
-
|
37
|
+
def test_must_return_a_valid_and_readable_name_from_a_broken_chatname_record
|
37
38
|
raw_chatname = '#something/$521357125362'
|
38
39
|
chatname = @format.parse_chatname raw_chatname
|
39
40
|
|
40
|
-
|
41
|
+
assert_equal 'something', chatname
|
41
42
|
end
|
42
43
|
|
43
|
-
|
44
|
+
def test_must_return_a_chatname_without_the_extra_symbols
|
44
45
|
raw_chatname = '#something/$else;521357125362'
|
45
46
|
chatname = @format.partly_parse_chatname raw_chatname
|
46
47
|
|
47
|
-
|
48
|
+
assert_equal '#something/$else;', chatname
|
48
49
|
end
|
49
50
|
|
50
|
-
|
51
|
+
def test_must_return_a_chatname_without_the_extra_symbols_for_a_broken_chatname_record
|
51
52
|
raw_chatname = '#something/$521357125362'
|
52
53
|
chatname = @format.partly_parse_chatname raw_chatname
|
53
54
|
|
54
|
-
|
55
|
+
assert_equal '#something/$', chatname
|
55
56
|
end
|
56
57
|
|
57
|
-
|
58
|
+
def test_must_return_a_string_without_skype_emotion_xml_tags
|
58
59
|
string = 'Some text <ss type="laugh">:D</ss>'
|
59
60
|
clean_string = @format.send :parse_body_xml, string
|
60
61
|
|
61
|
-
|
62
|
+
assert_equal 'Some text :D', clean_string
|
62
63
|
end
|
63
64
|
|
64
|
-
|
65
|
+
def test_must_remove_all_starting_and_ending_dashes_from_a_string
|
65
66
|
string = '---example--'
|
66
67
|
valid_name = @format.send :trim_dashes, string
|
67
68
|
|
68
|
-
|
69
|
+
assert_equal 'example', valid_name
|
69
70
|
end
|
70
71
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: runoff
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aigars Dzerviniks
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-06-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: commander
|