fillertext 0.2.0 → 0.3.4
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/.rspec +3 -0
- data/.rubocop.yml +179 -0
- data/CHANGELOG.md +70 -0
- data/CITATION.cff +13 -0
- data/Gemfile +16 -13
- data/LICENSE.txt +18 -17
- data/README.md +101 -0
- data/Rakefile +7 -46
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/lib/fillertext/fillertext.rb +27 -62
- data/lib/fillertext/integer.rb +15 -0
- data/lib/fillertext/styles/hipster.rb +8 -5
- data/lib/fillertext/styles/lorem.rb +8 -7
- data/lib/fillertext/styles/mike_lange.rb +42 -0
- data/lib/fillertext/styles/yinzer.rb +16 -10
- data/lib/fillertext/version.rb +5 -0
- data/lib/fillertext.rb +7 -5
- metadata +27 -54
- data/.document +0 -5
- data/.rvmrc +0 -1
- data/.travis.yml +0 -6
- data/Gemfile.lock +0 -79
- data/README.mkd +0 -81
- data/VERSION +0 -1
- data/fillertext.gemspec +0 -67
- data/lib/fillertext/fixnum.rb +0 -14
- data/spec/fillertext_spec.rb +0 -106
- data/test/fillertext_test.rb +0 -26
data/spec/fillertext_spec.rb
DELETED
@@ -1,106 +0,0 @@
|
|
1
|
-
require 'minitest/autorun'
|
2
|
-
begin; require 'turn'; rescue LoadError; rescue RuntimeError; end
|
3
|
-
require 'simplecov'
|
4
|
-
SimpleCov.start if ENV['COVERAGE']
|
5
|
-
require_relative '../lib/fillertext'
|
6
|
-
|
7
|
-
describe FillerText do
|
8
|
-
|
9
|
-
describe "when explicity called" do
|
10
|
-
include FillerText
|
11
|
-
|
12
|
-
before do
|
13
|
-
FillerText::FillerText.style = FillerText::Style::LoremIpsum
|
14
|
-
end
|
15
|
-
|
16
|
-
it "should output sentences" do
|
17
|
-
f = FillerText.sentences 5
|
18
|
-
#look for the periods
|
19
|
-
f.scan(/\./).size.must_equal 4
|
20
|
-
end
|
21
|
-
|
22
|
-
it "should output words" do
|
23
|
-
f = FillerText.words 5
|
24
|
-
#look for four spaces
|
25
|
-
f.must_equal "Lorem ipsum dolor sit amet"
|
26
|
-
end
|
27
|
-
|
28
|
-
it "should output characters" do
|
29
|
-
f = FillerText.characters 5
|
30
|
-
f.must_equal "Lorem"
|
31
|
-
end
|
32
|
-
|
33
|
-
it "should output bytes" do
|
34
|
-
f = FillerText.bytes 5
|
35
|
-
f.must_equal "Lorem"
|
36
|
-
end
|
37
|
-
|
38
|
-
it "should output paragraphs" do
|
39
|
-
f = FillerText.paragraphs 5
|
40
|
-
#look for newlines
|
41
|
-
f.scan(/\n/).size.must_equal 4
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
describe "when called from an integer" do
|
46
|
-
include FillerText
|
47
|
-
|
48
|
-
before do
|
49
|
-
FillerText::FillerText.style = FillerText::Style::LoremIpsum
|
50
|
-
end
|
51
|
-
|
52
|
-
it "should output sentences" do
|
53
|
-
f = 5.filler.sentences
|
54
|
-
#look for the periods
|
55
|
-
f.scan(/\./).size.must_equal 4
|
56
|
-
end
|
57
|
-
|
58
|
-
it "should output words" do
|
59
|
-
f = 3.filler.words
|
60
|
-
#look for four spaces
|
61
|
-
f.must_equal "Lorem ipsum dolor"
|
62
|
-
end
|
63
|
-
|
64
|
-
it "should output characters" do
|
65
|
-
f = 5.filler.characters
|
66
|
-
f.must_equal "Lorem"
|
67
|
-
end
|
68
|
-
|
69
|
-
it "should output bytes" do
|
70
|
-
f = 5.filler.bytes
|
71
|
-
f.must_equal "Lorem"
|
72
|
-
end
|
73
|
-
|
74
|
-
it "should output paragraphs" do
|
75
|
-
f = 5.filler.paragraphs
|
76
|
-
#look for newlines
|
77
|
-
f.scan(/\n/).size.must_equal 4
|
78
|
-
end
|
79
|
-
end
|
80
|
-
|
81
|
-
describe "when changing filler text style" do
|
82
|
-
include FillerText
|
83
|
-
|
84
|
-
it "should use LoremIpsum" do
|
85
|
-
FillerText::FillerText.style = FillerText::Style::LoremIpsum
|
86
|
-
t = "Lorem ipsum"
|
87
|
-
t.length.filler.characters.must_equal t
|
88
|
-
end
|
89
|
-
|
90
|
-
it "should use hipster ipsum" do
|
91
|
-
FillerText::FillerText.style = FillerText::Style::HipsterIpsum
|
92
|
-
t = "Hipster ipsum"
|
93
|
-
t.length.filler.characters.must_equal t
|
94
|
-
end
|
95
|
-
|
96
|
-
it "should use yinzer ipsum" do
|
97
|
-
t = "Yinzer ipsum"
|
98
|
-
FillerText::FillerText.style = FillerText::Style::YinzerIpsum
|
99
|
-
t.length.filler.characters.must_equal t
|
100
|
-
end
|
101
|
-
|
102
|
-
#add more styles here
|
103
|
-
|
104
|
-
end
|
105
|
-
|
106
|
-
end
|
data/test/fillertext_test.rb
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
require 'minitest/autorun'
|
2
|
-
require_relative '../lib/fillertext'
|
3
|
-
|
4
|
-
class FillerTextTest < MiniTest::Unit::TestCase
|
5
|
-
|
6
|
-
def setup
|
7
|
-
|
8
|
-
end
|
9
|
-
|
10
|
-
test "should generate some text" do
|
11
|
-
FillerText.sentences 5
|
12
|
-
FillerText.words 2
|
13
|
-
FillerText.characters 5
|
14
|
-
FillerText.bytes 4
|
15
|
-
FillerText.paragraphs 1
|
16
|
-
|
17
|
-
2.filler.sentences
|
18
|
-
1.filler.paragraphs
|
19
|
-
|
20
|
-
|
21
|
-
FillerText.style = FillerText::LoremIpsum
|
22
|
-
FillerText.style = FillerText::HipsterIpsum
|
23
|
-
FillerText.style = FillerText::YinzerIpsum
|
24
|
-
end
|
25
|
-
|
26
|
-
end
|