laranja 1.0.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,66 +0,0 @@
1
- require 'spec_helper'
2
-
3
- shared_examples 'a name generator' do |name|
4
- describe 'and' do
5
- it 'returns a string' do
6
- expect(name).to be_a_kind_of(String)
7
- end
8
-
9
- it 'returns a string with only one word' do
10
- expect(name.split.size).to eq(1)
11
- end
12
- end
13
- end
14
-
15
- describe Laranja::Name do
16
- describe '#name' do
17
-
18
- let(:n) { 1 + rand(3) }
19
-
20
- it 'returns a string' do
21
- expect(Laranja::Name.name).to be_a_kind_of(String)
22
- expect(Laranja::Name.name(2)).to be_a_kind_of(String)
23
- end
24
-
25
- it 'returns a first name and a last name' do
26
- expect(Laranja::Name.name.split.size).to be_between(2, 3)
27
- end
28
-
29
- it 'returns N last names when specified' do
30
- expect(Laranja::Name.name(n).split.size).to be_between(n + 1, n + 2)
31
- end
32
- end
33
-
34
- describe '#first_name' do
35
- it_behaves_like 'a name generator', Laranja::Name.first_name
36
- end
37
-
38
- describe '#last_name' do
39
- it_behaves_like 'a name generator', Laranja::Name.last_name
40
- end
41
-
42
- describe '#strf' do
43
-
44
- let(:n) { 1 + rand(3) }
45
-
46
- it_behaves_like 'a name generator', Laranja::Name.strf('%female_first_name')
47
- it_behaves_like 'a name generator', Laranja::Name.strf('%male_first_name')
48
- it_behaves_like 'a name generator', Laranja::Name.strf('%last_name')
49
- it_behaves_like 'a name generator', Laranja::Name.strf('%male_suffix')
50
- it_behaves_like 'a name generator', Laranja::Name.strf('%female_title')
51
- it_behaves_like 'a name generator', Laranja::Name.strf('%male_title')
52
-
53
- it 'returns N last names when specified' do
54
- expect(Laranja::Name.strf("%male_first_name#{ ' %last_name' * n }").split.size).to eq(n + 1)
55
- expect(Laranja::Name.strf("%female_first_name#{ ' %last_name' * n }").split.size).to eq(n + 1)
56
- end
57
-
58
- it 'returns N last names plus suffix when specified' do
59
- expect(Laranja::Name.strf("%male_first_name#{ ' %last_name' * n } %male_suffix").split.size).to eq(n + 2)
60
- end
61
-
62
- it 'returns a title when specified' do
63
- expect(Laranja::Name.strf("%female_title %female_first_name#{ ' %last_name' * n }").split.size).to eq(n + 2)
64
- end
65
- end
66
- end
@@ -1,7 +0,0 @@
1
- require 'coveralls'
2
- Coveralls.wear!
3
- require 'laranja'
4
-
5
- RSpec.configure do |config|
6
- config.order = 'random'
7
- end