chgk_rating 1.0.0.rc1 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/.github/ISSUE_TEMPLATE.md +12 -12
  3. data/.github/PULL_REQUEST_TEMPLATE.md +10 -10
  4. data/CHANGELOG.md +7 -0
  5. data/Gemfile +2 -6
  6. data/LICENSE +21 -21
  7. data/README.md +2 -1
  8. data/Rakefile +12 -12
  9. data/chgk_rating.gemspec +28 -28
  10. data/lib/chgk_rating.rb +51 -52
  11. data/lib/chgk_rating/attribute_mappings.rb +138 -137
  12. data/lib/chgk_rating/chgk_object.rb +12 -12
  13. data/lib/chgk_rating/client.rb +172 -172
  14. data/lib/chgk_rating/collections/base.rb +78 -78
  15. data/lib/chgk_rating/collections/players.rb +16 -16
  16. data/lib/chgk_rating/collections/ratings.rb +22 -22
  17. data/lib/chgk_rating/collections/recaps.rb +24 -24
  18. data/lib/chgk_rating/collections/teams.rb +16 -16
  19. data/lib/chgk_rating/collections/tournament_players.rb +23 -23
  20. data/lib/chgk_rating/collections/tournament_team_results.rb +23 -23
  21. data/lib/chgk_rating/collections/tournament_teams.rb +21 -21
  22. data/lib/chgk_rating/collections/tournaments.rb +46 -46
  23. data/lib/chgk_rating/concerns/searching.rb +24 -20
  24. data/lib/chgk_rating/connection.rb +18 -18
  25. data/lib/chgk_rating/error.rb +45 -45
  26. data/lib/chgk_rating/models/base.rb +89 -89
  27. data/lib/chgk_rating/models/player.rb +10 -10
  28. data/lib/chgk_rating/models/rating.rb +18 -18
  29. data/lib/chgk_rating/models/recap.rb +18 -18
  30. data/lib/chgk_rating/models/team.rb +61 -61
  31. data/lib/chgk_rating/models/tournament.rb +45 -45
  32. data/lib/chgk_rating/models/tournament_player.rb +7 -7
  33. data/lib/chgk_rating/models/tournament_team.rb +28 -28
  34. data/lib/chgk_rating/models/tournament_team_result.rb +7 -7
  35. data/lib/chgk_rating/request.rb +31 -31
  36. data/lib/chgk_rating/utils/snakecase.rb +15 -15
  37. data/lib/chgk_rating/utils/transformations.rb +82 -82
  38. data/lib/chgk_rating/version.rb +2 -2
  39. data/lib/ext/date.rb +10 -10
  40. data/lib/ext/date_time.rb +4 -4
  41. data/lib/ext/uri.rb +8 -8
  42. data/spec/lib/chgk_rating/client_spec.rb +207 -197
  43. data/spec/lib/chgk_rating/collections/players_spec.rb +44 -44
  44. data/spec/lib/chgk_rating/collections/ratings_spec.rb +24 -24
  45. data/spec/lib/chgk_rating/collections/recaps_spec.rb +20 -20
  46. data/spec/lib/chgk_rating/collections/teams_spec.rb +41 -41
  47. data/spec/lib/chgk_rating/collections/tournament_players_spec.rb +17 -17
  48. data/spec/lib/chgk_rating/collections/tournament_team_results_spec.rb +16 -16
  49. data/spec/lib/chgk_rating/collections/tournament_teams_spec.rb +59 -57
  50. data/spec/lib/chgk_rating/collections/tournaments_spec.rb +61 -61
  51. data/spec/lib/chgk_rating/models/base_spec.rb +33 -33
  52. data/spec/lib/chgk_rating/models/player_spec.rb +34 -34
  53. data/spec/lib/chgk_rating/models/rating_spec.rb +26 -26
  54. data/spec/lib/chgk_rating/models/recap_spec.rb +34 -34
  55. data/spec/lib/chgk_rating/models/team_spec.rb +88 -88
  56. data/spec/lib/chgk_rating/models/tournament_player_spec.rb +20 -20
  57. data/spec/lib/chgk_rating/models/tournament_spec.rb +91 -91
  58. data/spec/lib/chgk_rating/models/tournament_team_result_spec.rb +18 -18
  59. data/spec/lib/chgk_rating/models/tournament_team_spec.rb +35 -35
  60. data/spec/lib/chgk_rating/utils/snakecase_spec.rb +11 -11
  61. data/spec/lib/chgk_rating/utils/transformations_spec.rb +15 -15
  62. data/spec/lib/chgk_rating_spec.rb +4 -4
  63. data/spec/lib/ext/date_spec.rb +6 -6
  64. data/spec/lib/ext/date_time_spec.rb +10 -10
  65. data/spec/lib/ext/uri_spec.rb +6 -6
  66. data/spec/spec_helper.rb +12 -12
  67. data/spec/support/shared_examples.rb +62 -62
  68. data/spec/support/test_client.rb +5 -5
  69. data/spec/support/vcr.rb +10 -9
  70. metadata +5 -5
@@ -1,21 +1,21 @@
1
- RSpec.describe ChgkRating::Models::TournamentPlayer do
2
- subject do
3
- VCR.use_cassette 'team_players_at_tournament' do
4
- test_client.team_players_at_tournament(3506, 52853)[0]
5
- end
6
- end
7
- let(:tournament_player_h) { subject.to_h }
8
-
9
- it_behaves_like 'model without eager loading'
10
- it_behaves_like 'model without lazy support'
11
- it_behaves_like 'tournament team player' do
12
- let(:player) { subject }
13
- end
14
-
15
- specify '#to_h' do
16
- expect(tournament_player_h['idplayer']).to eq '51249'
17
- expect(tournament_player_h['is_captain']).to eq '1'
18
- expect(tournament_player_h['is_base']).to eq '1'
19
- expect(tournament_player_h['is_foreign']).to eq '0'
20
- end
1
+ RSpec.describe ChgkRating::Models::TournamentPlayer do
2
+ subject do
3
+ VCR.use_cassette 'team_players_at_tournament' do
4
+ test_client.team_players_at_tournament(3506, 52853)[0]
5
+ end
6
+ end
7
+ let(:tournament_player_h) { subject.to_h }
8
+
9
+ it_behaves_like 'model without eager loading'
10
+ it_behaves_like 'model without lazy support'
11
+ it_behaves_like 'tournament team player' do
12
+ let(:player) { subject }
13
+ end
14
+
15
+ specify '#to_h' do
16
+ expect(tournament_player_h['idplayer']).to eq '51249'
17
+ expect(tournament_player_h['is_captain']).to eq '1'
18
+ expect(tournament_player_h['is_base']).to eq '1'
19
+ expect(tournament_player_h['is_foreign']).to eq '0'
20
+ end
21
21
  end
@@ -1,92 +1,92 @@
1
- RSpec.describe ChgkRating::Models::Tournament do
2
- subject do
3
- VCR.use_cassette 'tournament' do
4
- described_class.new 3506
5
- end
6
- end
7
- let(:lazy_tournament) { described_class.new 3506, lazy: true }
8
- let(:tournament_h) { subject.to_h }
9
-
10
- it_behaves_like 'model with eager loading'
11
- it_behaves_like 'model with lazy support'
12
-
13
- specify('#id') { expect(subject.id).to eq '3506' }
14
- specify('#name') { expect(subject.name).to eq 'Чемпионат Перми и Пермского края' }
15
- specify('#long_name') { expect(subject.long_name).to eq 'XV Чемпионат Перми и Пермского края по игре "Что? Где? Когда?"' }
16
- specify('#date_start') { expect(subject.date_start).to eq DateTime.parse('2015-11-08 14:00:00') }
17
- specify('#date_end') { expect(subject.date_end).to eq DateTime.parse('2015-11-08 18:00:00') }
18
- specify('#tour_count') { expect(subject.tour_count).to eq 4 }
19
- specify('#tour_questions') { expect(subject.tour_questions).to eq 12 }
20
- specify('#tour_ques_per_tour') { expect(subject.tour_ques_per_tour).to eq 0 }
21
- specify('#questions_total') { expect(subject.questions_total).to eq 48 }
22
- specify('#type_name') { expect(subject.type_name).to eq 'Обычный' }
23
- specify('#main_payment_value') { expect(subject.main_payment_value).to eq 660 }
24
- specify('#discounted_payment_value') { expect(subject.discounted_payment_value).to eq 360 }
25
- specify('#discounted_payment_reason') { expect(subject.discounted_payment_reason).to eq 'для детских команд; 480 - для студенческих' }
26
- specify('#date_requests_allowed_to') { expect(subject.date_requests_allowed_to).to be_nil }
27
- specify('#comment') { expect(subject.comment).to eq '' }
28
- specify('#town') { expect(subject.town).to eq 'Пермь' }
29
- specify('#site_url') { expect(subject.site_url).to eq URI.parse('https://vk.com/chgk.perm.championship') }
30
- specify '#to_h' do
31
- expect(tournament_h['idtournament']).to eq '3506'
32
- expect(tournament_h['date_start']).to eq '2015-11-08T14:00:00+00:00'
33
- expect(tournament_h['date_end']).to eq '2015-11-08T18:00:00+00:00'
34
- expect(tournament_h['tour_count']).to eq '4'
35
- expect(tournament_h['tour_questions']).to eq '12'
36
- expect(tournament_h['tour_ques_per_tour']).to eq '0'
37
- expect(tournament_h['questions_total']).to eq '48'
38
- expect(tournament_h['main_payment_value']).to eq '660.0'
39
- expect(tournament_h['discounted_payment_value']).to eq '360.0'
40
- expect(tournament_h['date_requests_allowed_to']).to eq ''
41
- expect(tournament_h['site_url']).to eq 'https://vk.com/chgk.perm.championship'
42
- expect(tournament_h['name']).to eq 'Чемпионат Перми и Пермского края'
43
- expect(tournament_h['town']).to eq 'Пермь'
44
- expect(tournament_h['long_name']).to eq 'XV Чемпионат Перми и Пермского края по игре "Что? Где? Когда?"'
45
- expect(tournament_h['type_name']).to eq 'Обычный'
46
- expect(tournament_h['discounted_payment_reason']).to eq 'для детских команд; 480 - для студенческих'
47
- expect(tournament_h['comment']).to eq ''
48
- end
49
-
50
- specify '#eager_load!' do
51
- VCR.use_cassette 'tournament' do
52
- lazy_tournament.eager_load!
53
- end
54
- expect(lazy_tournament.name).to eq 'Чемпионат Перми и Пермского края'
55
- end
56
-
57
- describe '#team_results' do
58
- let(:team_results) do
59
- VCR.use_cassette 'team_results_at_tournament' do
60
- subject.team_results(52853)
61
- end
62
- end
63
-
64
- it { expect(team_results).to be_an_instance_of ChgkRating::Collections::TournamentTeamResults }
65
- end
66
-
67
- describe '#team_players' do
68
- let(:players) do
69
- VCR.use_cassette 'team_players_at_tournament' do
70
- subject.team_players(52853)
71
- end
72
- end
73
-
74
- it { expect(players).to be_an_instance_of ChgkRating::Collections::TournamentPlayers }
75
- end
76
-
77
- describe '#team' do
78
- let(:team) { subject.team 52853 }
79
-
80
- it { expect(team).to be_an_instance_of ChgkRating::Models::TournamentTeam }
81
- end
82
-
83
- describe '#team_list' do
84
- let(:team_list) do
85
- VCR.use_cassette 'teams_at_tournament' do
86
- subject.team_list
87
- end
88
- end
89
-
90
- it { expect(team_list).to be_an_instance_of ChgkRating::Collections::TournamentTeams }
91
- end
1
+ RSpec.describe ChgkRating::Models::Tournament do
2
+ subject do
3
+ VCR.use_cassette 'tournament' do
4
+ described_class.new 3506
5
+ end
6
+ end
7
+ let(:lazy_tournament) { described_class.new 3506, lazy: true }
8
+ let(:tournament_h) { subject.to_h }
9
+
10
+ it_behaves_like 'model with eager loading'
11
+ it_behaves_like 'model with lazy support'
12
+
13
+ specify('#id') { expect(subject.id).to eq '3506' }
14
+ specify('#name') { expect(subject.name).to eq 'Чемпионат Перми и Пермского края' }
15
+ specify('#long_name') { expect(subject.long_name).to eq 'XV Чемпионат Перми и Пермского края по игре "Что? Где? Когда?"' }
16
+ specify('#date_start') { expect(subject.date_start).to eq DateTime.parse('2015-11-08 14:00:00') }
17
+ specify('#date_end') { expect(subject.date_end).to eq DateTime.parse('2015-11-08 18:00:00') }
18
+ specify('#tour_count') { expect(subject.tour_count).to eq 4 }
19
+ specify('#tour_questions') { expect(subject.tour_questions).to eq 12 }
20
+ specify('#tour_ques_per_tour') { expect(subject.tour_ques_per_tour).to eq 0 }
21
+ specify('#questions_total') { expect(subject.questions_total).to eq 48 }
22
+ specify('#type_name') { expect(subject.type_name).to eq 'Обычный' }
23
+ specify('#main_payment_value') { expect(subject.main_payment_value).to eq 660 }
24
+ specify('#discounted_payment_value') { expect(subject.discounted_payment_value).to eq 360 }
25
+ specify('#discounted_payment_reason') { expect(subject.discounted_payment_reason).to eq 'для детских команд; 480 - для студенческих' }
26
+ specify('#date_requests_allowed_to') { expect(subject.date_requests_allowed_to).to be_nil }
27
+ specify('#comment') { expect(subject.comment).to eq '' }
28
+ specify('#town') { expect(subject.town).to eq 'Пермь' }
29
+ specify('#site_url') { expect(subject.site_url).to eq URI.parse('https://vk.com/chgk.perm.championship') }
30
+ specify '#to_h' do
31
+ expect(tournament_h['idtournament']).to eq '3506'
32
+ expect(tournament_h['date_start']).to eq '2015-11-08T14:00:00+00:00'
33
+ expect(tournament_h['date_end']).to eq '2015-11-08T18:00:00+00:00'
34
+ expect(tournament_h['tour_count']).to eq '4'
35
+ expect(tournament_h['tour_questions']).to eq '12'
36
+ expect(tournament_h['tour_ques_per_tour']).to eq '0'
37
+ expect(tournament_h['questions_total']).to eq '48'
38
+ expect(tournament_h['main_payment_value']).to eq '660.0'
39
+ expect(tournament_h['discounted_payment_value']).to eq '360.0'
40
+ expect(tournament_h['date_requests_allowed_to']).to eq ''
41
+ expect(tournament_h['site_url']).to eq 'https://vk.com/chgk.perm.championship'
42
+ expect(tournament_h['name']).to eq 'Чемпионат Перми и Пермского края'
43
+ expect(tournament_h['town']).to eq 'Пермь'
44
+ expect(tournament_h['long_name']).to eq 'XV Чемпионат Перми и Пермского края по игре "Что? Где? Когда?"'
45
+ expect(tournament_h['type_name']).to eq 'Обычный'
46
+ expect(tournament_h['discounted_payment_reason']).to eq 'для детских команд; 480 - для студенческих'
47
+ expect(tournament_h['comment']).to eq ''
48
+ end
49
+
50
+ specify '#eager_load!' do
51
+ VCR.use_cassette 'tournament' do
52
+ lazy_tournament.eager_load!
53
+ end
54
+ expect(lazy_tournament.name).to eq 'Чемпионат Перми и Пермского края'
55
+ end
56
+
57
+ describe '#team_results' do
58
+ let(:team_results) do
59
+ VCR.use_cassette 'team_results_at_tournament' do
60
+ subject.team_results(52853)
61
+ end
62
+ end
63
+
64
+ it { expect(team_results).to be_an_instance_of ChgkRating::Collections::TournamentTeamResults }
65
+ end
66
+
67
+ describe '#team_players' do
68
+ let(:players) do
69
+ VCR.use_cassette 'team_players_at_tournament' do
70
+ subject.team_players(52853)
71
+ end
72
+ end
73
+
74
+ it { expect(players).to be_an_instance_of ChgkRating::Collections::TournamentPlayers }
75
+ end
76
+
77
+ describe '#team' do
78
+ let(:team) { subject.team 52853 }
79
+
80
+ it { expect(team).to be_an_instance_of ChgkRating::Models::TournamentTeam }
81
+ end
82
+
83
+ describe '#team_list' do
84
+ let(:team_list) do
85
+ VCR.use_cassette 'teams_at_tournament' do
86
+ subject.team_list
87
+ end
88
+ end
89
+
90
+ it { expect(team_list).to be_an_instance_of ChgkRating::Collections::TournamentTeams }
91
+ end
92
92
  end
@@ -1,19 +1,19 @@
1
- RSpec.describe ChgkRating::Models::TournamentTeamResult do
2
- subject do
3
- VCR.use_cassette 'team_results_at_tournament' do
4
- test_client.team_results_at_tournament(3506, 52853)[0]
5
- end
6
- end
7
- let(:tournament_team_result_h) { subject.to_h }
8
-
9
- it_behaves_like 'model without eager loading'
10
- it_behaves_like 'model without lazy support'
11
- it_behaves_like 'tournament team result' do
12
- let(:team_result) { subject }
13
- end
14
-
15
- specify '#to_h' do
16
- expect(tournament_team_result_h['tour']).to eq '1'
17
- expect(tournament_team_result_h['mask']).to eq %w(0 0 0 0 1 1 1 0 0 1 0 0)
18
- end
1
+ RSpec.describe ChgkRating::Models::TournamentTeamResult do
2
+ subject do
3
+ VCR.use_cassette 'team_results_at_tournament' do
4
+ test_client.team_results_at_tournament(3506, 52853)[0]
5
+ end
6
+ end
7
+ let(:tournament_team_result_h) { subject.to_h }
8
+
9
+ it_behaves_like 'model without eager loading'
10
+ it_behaves_like 'model without lazy support'
11
+ it_behaves_like 'tournament team result' do
12
+ let(:team_result) { subject }
13
+ end
14
+
15
+ specify '#to_h' do
16
+ expect(tournament_team_result_h['tour']).to eq '1'
17
+ expect(tournament_team_result_h['mask']).to eq %w(0 0 0 0 1 1 1 0 0 1 0 0)
18
+ end
19
19
  end
@@ -1,36 +1,36 @@
1
- RSpec.describe ChgkRating::Models::TournamentTeam do
2
- # this is always a lazily-loaded object as
3
- # we cannot get info about a specific team participating in a tournament!
4
- subject { described_class.new '52853', tournament: '3506', lazy: true }
5
- let(:tournament_team_h) { subject.to_h }
6
-
7
- it_behaves_like 'model without eager loading'
8
- it_behaves_like 'model with lazy support'
9
-
10
- specify('#tournament') { expect(subject.tournament.id).to eq '3506' }
11
- specify('#team') { expect(subject.team.id).to eq '52853' }
12
- specify('#id') { expect(subject.id).to eq '52853' }
13
- specify '#to_h' do
14
- expect(tournament_team_h['idteam']).to eq '52853'
15
- end
16
-
17
- describe '#players' do
18
- let(:players) do
19
- VCR.use_cassette 'team_players_at_tournament' do
20
- subject.players
21
- end
22
- end
23
-
24
- it { expect(players).to be_an_instance_of ChgkRating::Collections::TournamentPlayers }
25
- end
26
-
27
- describe '#results' do
28
- let(:results) do
29
- VCR.use_cassette 'team_results_at_tournament' do
30
- subject.results
31
- end
32
- end
33
-
34
- it { expect(results).to be_an_instance_of ChgkRating::Collections::TournamentTeamResults }
35
- end
1
+ RSpec.describe ChgkRating::Models::TournamentTeam do
2
+ # this is always a lazily-loaded object as
3
+ # we cannot get info about a specific team participating in a tournament!
4
+ subject { described_class.new '52853', tournament: '3506', lazy: true }
5
+ let(:tournament_team_h) { subject.to_h }
6
+
7
+ it_behaves_like 'model without eager loading'
8
+ it_behaves_like 'model with lazy support'
9
+
10
+ specify('#tournament') { expect(subject.tournament.id).to eq '3506' }
11
+ specify('#team') { expect(subject.team.id).to eq '52853' }
12
+ specify('#id') { expect(subject.id).to eq '52853' }
13
+ specify '#to_h' do
14
+ expect(tournament_team_h['idteam']).to eq '52853'
15
+ end
16
+
17
+ describe '#players' do
18
+ let(:players) do
19
+ VCR.use_cassette 'team_players_at_tournament' do
20
+ subject.players
21
+ end
22
+ end
23
+
24
+ it { expect(players).to be_an_instance_of ChgkRating::Collections::TournamentPlayers }
25
+ end
26
+
27
+ describe '#results' do
28
+ let(:results) do
29
+ VCR.use_cassette 'team_results_at_tournament' do
30
+ subject.results
31
+ end
32
+ end
33
+
34
+ it { expect(results).to be_an_instance_of ChgkRating::Collections::TournamentTeamResults }
35
+ end
36
36
  end
@@ -1,12 +1,12 @@
1
- RSpec.describe String do
2
- describe '#snakecase_upcase' do
3
- let(:result) { 'SNAKE_CASE' }
4
-
5
- it 'should convert the string properly' do
6
- expect('SnakeCase'.snakecase_upcase).to eq result
7
- expect('Snake-Case'.snakecase_upcase).to eq result
8
- expect('Snake Case'.snakecase_upcase).to eq result
9
- expect('Snake - Case'.snakecase_upcase).to eq result
10
- end
11
- end
1
+ RSpec.describe String do
2
+ describe '#snakecase_upcase' do
3
+ let(:result) { 'SNAKE_CASE' }
4
+
5
+ it 'should convert the string properly' do
6
+ expect('SnakeCase'.snakecase_upcase).to eq result
7
+ expect('Snake-Case'.snakecase_upcase).to eq result
8
+ expect('Snake Case'.snakecase_upcase).to eq result
9
+ expect('Snake - Case'.snakecase_upcase).to eq result
10
+ end
11
+ end
12
12
  end
@@ -1,16 +1,16 @@
1
- RSpec.describe ChgkRating::Utils::Transformations do
2
- specify '.to_boolean' do
3
- expect(described_class.send(:to_boolean).call('1')).to eq(true)
4
- expect(described_class.send(:to_boolean).call('0')).to eq(false)
5
- end
6
-
7
- specify '.to_binary_boolean' do
8
- expect(described_class.send(:to_binary_boolean).call(true)).to eq('1')
9
- expect(described_class.send(:to_binary_boolean).call(false)).to eq('0')
10
- end
11
-
12
- specify '.to_star' do
13
- expect(described_class.send(:to_star, :to_i).call('1')).to eq(1)
14
- expect(described_class.send(:to_star, :to_sym, true).call(%w(one two apple))).to eq(%i(one two apple))
15
- end
1
+ RSpec.describe ChgkRating::Utils::Transformations do
2
+ specify '.to_boolean' do
3
+ expect(described_class.send(:to_boolean).call('1')).to eq(true)
4
+ expect(described_class.send(:to_boolean).call('0')).to eq(false)
5
+ end
6
+
7
+ specify '.to_binary_boolean' do
8
+ expect(described_class.send(:to_binary_boolean).call(true)).to eq('1')
9
+ expect(described_class.send(:to_binary_boolean).call(false)).to eq('0')
10
+ end
11
+
12
+ specify '.to_star' do
13
+ expect(described_class.send(:to_star, :to_i).call('1')).to eq(1)
14
+ expect(described_class.send(:to_star, :to_sym, true).call(%w(one two apple))).to eq(%i(one two apple))
15
+ end
16
16
  end
@@ -1,5 +1,5 @@
1
- RSpec.describe ChgkRating do
2
- specify '.client' do
3
- expect(ChgkRating.client).to be_an_instance_of(ChgkRating::Client)
4
- end
1
+ RSpec.describe ChgkRating do
2
+ specify '.client' do
3
+ expect(ChgkRating.client).to be_an_instance_of(ChgkRating::Client)
4
+ end
5
5
  end
@@ -1,7 +1,7 @@
1
- RSpec.describe Date do
2
- specify '.parse_safely' do
3
- expect(described_class.parse_safely('2017-09-28 12:00:33').to_s).to eq('2017-09-28')
4
- expect(described_class.parse_safely('gibberish')).to be_nil
5
- expect(described_class.parse_safely(nil)).to be_nil
6
- end
1
+ RSpec.describe Date do
2
+ specify '.parse_safely' do
3
+ expect(described_class.parse_safely('2017-09-28 12:00:33').to_s).to eq('2017-09-28')
4
+ expect(described_class.parse_safely('gibberish')).to be_nil
5
+ expect(described_class.parse_safely(nil)).to be_nil
6
+ end
7
7
  end
@@ -1,11 +1,11 @@
1
- RSpec.describe DateTime do
2
- subject { DateTime.new(2018,01,24,16,58,34) }
3
-
4
- specify '#to_s_chgk' do
5
- expect(subject.to_s_chgk).to eq '2018-01-24 16:58:34'
6
- end
7
-
8
- specify '.parse_safely' do
9
- expect(described_class.parse_safely('2017-09-28 12:00:33').to_s).to eq('2017-09-28T12:00:33+00:00')
10
- end
1
+ RSpec.describe DateTime do
2
+ subject { DateTime.new(2018,01,24,16,58,34) }
3
+
4
+ specify '#to_s_chgk' do
5
+ expect(subject.to_s_chgk).to eq '2018-01-24 16:58:34'
6
+ end
7
+
8
+ specify '.parse_safely' do
9
+ expect(described_class.parse_safely('2017-09-28 12:00:33').to_s).to eq('2017-09-28T12:00:33+00:00')
10
+ end
11
11
  end
@@ -1,7 +1,7 @@
1
- RSpec.describe URI do
2
- specify '.parse_safely' do
3
- expect(described_class.parse_safely('http://example.com/test').to_s).to eq('http://example.com/test')
4
- expect(described_class.parse_safely('gibberish').to_s).to eq 'gibberish'
5
- expect(described_class.parse_safely(nil)).to be_nil
6
- end
1
+ RSpec.describe URI do
2
+ specify '.parse_safely' do
3
+ expect(described_class.parse_safely('http://example.com/test').to_s).to eq('http://example.com/test')
4
+ expect(described_class.parse_safely('gibberish').to_s).to eq 'gibberish'
5
+ expect(described_class.parse_safely(nil)).to be_nil
6
+ end
7
7
  end