meetup-generator 0.0.20210128 → 1.2.84

Sign up to get free protection for your applications and to get access to all the features.
data/lib/words.gz DELETED
Binary file
@@ -1,138 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- require 'pathname'
5
- require 'minitest/autorun'
6
- require_relative '../lib/meetup_generator'
7
-
8
- THINGS = { food_style: %w[artisan],
9
- food: %w[flatbread],
10
- first_name: %w[John],
11
- last_name: %w[Smith],
12
- job_role: %w[Neckbeard],
13
- job_title: ['Without Portfolio'],
14
- tech: %w[Ruby],
15
- something_ops: %w[Dev Test No],
16
- template: ['%RAND20% %tech% things'] }.freeze
17
-
18
- class TestMeetupGenerator < Minitest::Test
19
- attr_reader :mg
20
-
21
- def setup
22
- @mg = MeetupGenerator.new
23
- end
24
-
25
- def test_words
26
- assert_instance_of(Array, mg.words)
27
- assert mg.words.size > 19_000
28
- assert_includes(mg.words, 'woebegone')
29
- end
30
-
31
- def test_lib
32
- assert_instance_of(Hash, mg.lib)
33
- assert_includes(mg.lib[:tech], 'SmartOS')
34
-
35
- %i[verb tech service extreme quantifier time food_style food
36
- skill_level is_not company driver adjective panacea language
37
- something_ops template first_name last_name job_role
38
- job_title].each do |k|
39
- assert_includes(mg.lib.keys, k)
40
- assert_instance_of(Array, mg.lib[k])
41
- end
42
- end
43
- end
44
-
45
- # We don't want the class properly initialized
46
- #
47
- class Giblets < MeetupGenerator
48
- # rubocop:disable Lint/MissingSuper
49
- def initialize; end
50
- # rubocop:enable Lint/MissingSuper
51
- end
52
-
53
- # Test the uninitialized class
54
- #
55
- class GibletsTest < MiniTest::Test
56
- attr_reader :m
57
-
58
- def setup
59
- @m = Giblets.new
60
- m.instance_variable_set(:@lib, THINGS)
61
- m.instance_variable_set(:@words, %w[leadswinger])
62
- end
63
-
64
- def _test_title
65
- x = m.title
66
- assert_instance_of(String, x)
67
- assert !x.empty?
68
- refute_match(/%\w+%/, x)
69
- end
70
-
71
- def test_agenda
72
- agenda = m.agenda(1)
73
- talks = agenda[:talks]
74
-
75
- assert_instance_of(Array, talks)
76
- assert_equal(1, talks.size)
77
-
78
- talk = talks.first
79
- assert_instance_of(Hash, talk)
80
-
81
- assert_equal(%i[title talker role company], talk.keys)
82
- tokens = talk[:title].split
83
- number = tokens.first.to_i
84
- assert number.positive?
85
- assert number <= 20
86
- assert_equal('Ruby', tokens[1])
87
- assert_equal('things', tokens[2])
88
-
89
- assert_equal('artisan flatbread', agenda[:refreshment])
90
- end
91
-
92
- def test_something_ops
93
- assert m.something_ops.is_a?(String)
94
- assert m.something_ops.end_with?('Ops')
95
- end
96
-
97
- def test_talker
98
- assert_equal('John Smith', m.talker)
99
- end
100
-
101
- def test_role
102
- assert_equal('Neckbeard Without Portfolio', m.role)
103
- end
104
-
105
- def test_company_no_e
106
- assert_equal('leadswingr.io', m.company)
107
- end
108
-
109
- def test_company
110
- m.instance_variable_set(:@words, %w[cabbage])
111
- assert_equal('cabbage.io', m.company)
112
- end
113
-
114
- def test_replace_word
115
- assert_equal('LeadswingerOps', m.replace_word('%WORD%Ops'))
116
- end
117
-
118
- def test_refreshment
119
- assert_equal('artisan flatbread', m.refreshment)
120
- end
121
-
122
- def test_replace_things
123
- x = m.replace_things('%tech% is %tech%')
124
- assert_equal('Ruby is Ruby', x)
125
- end
126
-
127
- def test_replace_ops
128
- x = m.replace_ops('From %FNOPS% to %FNOPS%')
129
- assert_instance_of(String, x)
130
- assert_match(/From \w+Ops to \w+Ops$/, x)
131
- end
132
-
133
- def test_replace_number
134
- x = m.replace_number('%RAND9% years and %RAND5% months')
135
- assert_instance_of(String, x)
136
- assert_match(/\d years and \d months/, x)
137
- end
138
- end
@@ -1,11 +0,0 @@
1
- - talk = @agenda[:talks].pop
2
-
3
- span.ttitle=talk[:title]
4
- .indent
5
- => talk[:talker]
6
- ' //
7
- => talk[:role]
8
- ' @
9
- a href="http://#{talk[:company]}"
10
- == talk[:company]
11
-