rubbish_code 1.1.1 → 1.1.2
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/lib/rubbish_code/version.rb +1 -1
- data/rubbish_code-1.1.1.gem +0 -0
- metadata +2 -2
- data/lib/source/models/student_test.rb +0 -71
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bcca354a4ed34bf8fadbca3bea1446428d093658c6e04a9a9e55392519595c2a
|
4
|
+
data.tar.gz: 8e2050f98952c6a81f20b5d06f57daf0aebebe52a37c52274043d3d568d4ad77
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 60c01d2085635ddecf247c739ff1c66705bc790b807fb1e91d564eb67c801daad10fc14427b62d7571d4398afa581e8c300dc9b8ddd7dc141626704aa0335961
|
7
|
+
data.tar.gz: 62330e0e25cd7f637aa6c0a56d5828077ff0536e2e55ca7186f50559322d13e981b5614634e5d77ad51e2472694be8b96854da28ba298c5af464d8ab7df0c529
|
data/lib/rubbish_code/version.rb
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubbish_code
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jake Epps
|
@@ -48,7 +48,6 @@ files:
|
|
48
48
|
- lib/source/models/student.rb
|
49
49
|
- lib/source/models/student_base.rb
|
50
50
|
- lib/source/models/student_short.rb
|
51
|
-
- lib/source/models/student_test.rb
|
52
51
|
- lib/source/repositories/adapters/db_source_adapter.rb
|
53
52
|
- lib/source/repositories/adapters/file_source_adapter.rb
|
54
53
|
- lib/source/repositories/containers/data_list.rb
|
@@ -65,6 +64,7 @@ files:
|
|
65
64
|
- lib/source/views/student_input_form.rb
|
66
65
|
- lib/source/views/tab_students.rb
|
67
66
|
- rubbish_code-1.1.0.gem
|
67
|
+
- rubbish_code-1.1.1.gem
|
68
68
|
- rubbish_code.gemspec
|
69
69
|
- sig/ribbish_code.rbs
|
70
70
|
homepage: https://github.com/Jakepps/Ruby_Moment
|
@@ -1,71 +0,0 @@
|
|
1
|
-
require 'test/unit'
|
2
|
-
require_relative 'student'
|
3
|
-
|
4
|
-
class TestStudent < Test::Unit::TestCase
|
5
|
-
def setup
|
6
|
-
@student = Student.new('Иванов', 'Иван', 'Иванович')
|
7
|
-
end
|
8
|
-
|
9
|
-
def test_full_name
|
10
|
-
assert_equal('Иванов Иван Иванович', @student.to_s.split(', ')[0])
|
11
|
-
end
|
12
|
-
|
13
|
-
def test_contacts
|
14
|
-
@student = Student.new('Иванов', 'Иван', 'Иванович')
|
15
|
-
@student.set_contacts(phone: '+79991234567', email: 'ivanov@example.com')
|
16
|
-
assert_equal('+79991234567', @student.phone)
|
17
|
-
assert_equal('ivanov@example.com', @student.email)
|
18
|
-
end
|
19
|
-
|
20
|
-
def test_valid_name
|
21
|
-
assert(Student.valid_name?('Иванов'))
|
22
|
-
assert(!Student.valid_name?('Сидоров-Петров'))
|
23
|
-
assert(!Student.valid_name?('X'))
|
24
|
-
assert(Student.valid_name?('Abcdefghijklmnopqrstuvwxyz'))
|
25
|
-
assert(!Student.valid_name?(''))
|
26
|
-
assert(!Student.valid_name?('Иванов 123'))
|
27
|
-
assert(!Student.valid_name?('Иванов.'))
|
28
|
-
assert(!Student.valid_name?('-Иванов'))
|
29
|
-
end
|
30
|
-
|
31
|
-
def test_from_hash
|
32
|
-
hash = {
|
33
|
-
first_name: 'Иван',
|
34
|
-
last_name: 'Иванов',
|
35
|
-
father_name: 'Иванович',
|
36
|
-
phone: '+79991234567',
|
37
|
-
telegram: 'ivanov',
|
38
|
-
email: 'ivanov@example.com',
|
39
|
-
git: 'ivanov'
|
40
|
-
}
|
41
|
-
student = Student.from_hash(hash)
|
42
|
-
assert_equal(hash[:first_name], student.first_name)
|
43
|
-
assert_equal(hash[:last_name], student.last_name)
|
44
|
-
assert_equal(hash[:father_name], student.father_name)
|
45
|
-
assert_equal(hash[:phone], student.phone)
|
46
|
-
assert_equal(hash[:telegram], student.telegram)
|
47
|
-
assert_equal(hash[:email], student.email)
|
48
|
-
assert_equal(hash[:git], student.git)
|
49
|
-
end
|
50
|
-
|
51
|
-
def test_from_json_str
|
52
|
-
hash = {
|
53
|
-
first_name: 'Иван',
|
54
|
-
last_name: 'Иванов',
|
55
|
-
father_name: 'Иванович',
|
56
|
-
phone: '+79991234567',
|
57
|
-
telegram: 'ivanov',
|
58
|
-
email: 'ivanov@example.com',
|
59
|
-
git: 'ivanov'
|
60
|
-
}
|
61
|
-
json_str = hash.to_json
|
62
|
-
student = Student.from_json_str(json_str)
|
63
|
-
assert_equal(hash[:first_name], student.first_name)
|
64
|
-
assert_equal(hash[:last_name], student.last_name)
|
65
|
-
assert_equal(hash[:father_name], student.father_name)
|
66
|
-
assert_equal(hash[:phone], student.phone)
|
67
|
-
assert_equal(hash[:telegram], student.telegram)
|
68
|
-
assert_equal(hash[:email], student.email)
|
69
|
-
assert_equal(hash[:git], student.git)
|
70
|
-
end
|
71
|
-
end
|