gitara 1.0.1 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,324 +3,324 @@ require 'spec_helper'
3
3
  describe Gitara::Dsl do
4
4
  describe "#bar" do
5
5
  it "should add a bar with the name" do
6
- dsl = FactoryGirl.build(:dsl, :node => FactoryGirl.build(:tab, :children => []))
7
- dsl.node.children.should be_empty
6
+ dsl = FactoryBot.build(:dsl, :node => FactoryBot.build(:tab, :children => []))
7
+ expect(dsl.node.children).to be_empty
8
8
 
9
9
  dsl.bar 'Intro'
10
10
 
11
- dsl.node.children.should have(1).bar
11
+ expect(dsl.node.children.size).to eq(1)
12
12
 
13
13
  bar = dsl.node.children[0]
14
- bar.name.should == 'Intro'
15
- bar.children.should be_empty
14
+ expect(bar.name).to eq('Intro')
15
+ expect(bar.children).to be_empty
16
16
  end
17
17
 
18
18
  it "should add the definition_children declared in the block to the bar" do
19
- dsl = FactoryGirl.build(:dsl, :node => FactoryGirl.build(:tab, :children => []))
20
- dsl.node.children.should be_empty
19
+ dsl = FactoryBot.build(:dsl, :node => FactoryBot.build(:tab, :children => []))
20
+ expect(dsl.node.children).to be_empty
21
21
 
22
- note_set = FactoryGirl.build(:note_set)
22
+ note_set = FactoryBot.build(:note_set)
23
23
 
24
24
  dsl.bar 'Intro' do
25
25
  add note_set
26
26
  end
27
27
 
28
- dsl.node.children.should have(1).bar
29
- dsl.node.children[0].name.should == 'Intro'
28
+ expect(dsl.node.children.size).to eq(1)
29
+ expect(dsl.node.children[0].name).to eq('Intro')
30
30
 
31
31
  bar = dsl.node.children[0]
32
- bar.children.should have(1).note_set
33
- bar.children[0].should == note_set
32
+ expect(bar.children.size).to eq(1)
33
+ expect(bar.children[0]).to eq(note_set)
34
34
  end
35
35
  end
36
36
 
37
37
  describe "#add" do
38
38
  it "should add the child to the dsl's node" do
39
- dsl = FactoryGirl.build(:dsl, :node => FactoryGirl.build(:tab, :children => []))
40
- dsl.node.children.should be_empty
39
+ dsl = FactoryBot.build(:dsl, :node => FactoryBot.build(:tab, :children => []))
40
+ expect(dsl.node.children).to be_empty
41
41
 
42
- bar = FactoryGirl.build(:bar, :name => 'Intro')
42
+ bar = FactoryBot.build(:bar, :name => 'Intro')
43
43
 
44
44
  dsl.add bar
45
45
 
46
- dsl.node.children.should have(1).bar
47
- dsl.node.children[0].should == bar
46
+ expect(dsl.node.children.size).to eq(1)
47
+ expect(dsl.node.children[0]).to eq(bar)
48
48
  end
49
49
 
50
50
  it "should add the definition_children in the block to the child" do
51
- dsl = FactoryGirl.build(:dsl, :node => FactoryGirl.build(:tab, :children => []))
52
- dsl.node.children.should be_empty
51
+ dsl = FactoryBot.build(:dsl, :node => FactoryBot.build(:tab, :children => []))
52
+ expect(dsl.node.children).to be_empty
53
53
 
54
- bar = FactoryGirl.build(:bar, :children => [])
55
- note_set = FactoryGirl.build(:note_set)
54
+ bar = FactoryBot.build(:bar, :children => [])
55
+ note_set = FactoryBot.build(:note_set)
56
56
 
57
57
  dsl.add bar do
58
58
  add note_set
59
59
  end
60
60
 
61
- dsl.node.children.should have(1).bar
62
- dsl.node.children[0].should == bar
61
+ expect(dsl.node.children.size).to eq(1)
62
+ expect(dsl.node.children[0]).to eq(bar)
63
63
 
64
- bar.children.should have(1).note_set
65
- bar.children[0].should == note_set
64
+ expect(bar.children.size).to eq(1)
65
+ expect(bar.children[0]).to eq(note_set)
66
66
  end
67
67
  end
68
68
 
69
69
  describe "#notes" do
70
70
  it "should add a note set with the value" do
71
- dsl = FactoryGirl.build(:dsl, :node => FactoryGirl.build(:bar, :children => []))
72
- dsl.node.children.should be_empty
71
+ dsl = FactoryBot.build(:dsl, :node => FactoryBot.build(:bar, :children => []))
72
+ expect(dsl.node.children).to be_empty
73
73
 
74
74
  dsl.notes 'test'
75
75
 
76
- dsl.node.children.should have(1).note_set
77
- dsl.node.children[0].value.should == 'test'
76
+ expect(dsl.node.children.size).to eq(1)
77
+ expect(dsl.node.children[0].value).to eq('test')
78
78
  end
79
79
  end
80
80
 
81
81
  describe "#line" do
82
82
  it "should add a line with the name" do
83
- dsl = FactoryGirl.build(:dsl, :node => FactoryGirl.build(:tab, :children => []))
84
- dsl.node.children.should be_empty
83
+ dsl = FactoryBot.build(:dsl, :node => FactoryBot.build(:tab, :children => []))
84
+ expect(dsl.node.children).to be_empty
85
85
 
86
86
  dsl.line 'Intro'
87
87
 
88
- dsl.node.children.should have(1).line
88
+ expect(dsl.node.children.size).to eq(1)
89
89
 
90
90
  line = dsl.node.children[0]
91
- line.name.should == 'Intro'
92
- line.children.should be_empty
91
+ expect(line.name).to eq('Intro')
92
+ expect(line.children).to be_empty
93
93
  end
94
94
 
95
95
  it "should add the definition_children declared in the block to the line" do
96
- dsl = FactoryGirl.build(:dsl, :node => FactoryGirl.build(:tab, :children => []))
97
- dsl.node.children.should be_empty
96
+ dsl = FactoryBot.build(:dsl, :node => FactoryBot.build(:tab, :children => []))
97
+ expect(dsl.node.children).to be_empty
98
98
 
99
- bar = FactoryGirl.build(:bar)
99
+ bar = FactoryBot.build(:bar)
100
100
 
101
101
  dsl.line 'Intro' do
102
102
  add bar
103
103
  end
104
104
 
105
- dsl.node.children.should have(1).line
106
- dsl.node.children[0].name.should == 'Intro'
105
+ expect(dsl.node.children.size).to eq(1)
106
+ expect(dsl.node.children[0].name).to eq('Intro')
107
107
 
108
108
  line = dsl.node.children[0]
109
- line.children.should have(1).bar
110
- line.children[0].should == bar
109
+ expect(line.children.size).to eq(1)
110
+ expect(line.children[0]).to eq(bar)
111
111
  end
112
112
 
113
113
  it "should allow breaking to be toggled" do
114
- dsl = FactoryGirl.build(:dsl, :node => FactoryGirl.build(:tab, :children => []))
114
+ dsl = FactoryBot.build(:dsl, :node => FactoryBot.build(:tab, :children => []))
115
115
  dsl.line :manual_break => false
116
116
 
117
- dsl.node.children.should have(1).line
118
- dsl.node.children[0].name.should == 'TabOneLineOne' # not manual_breaking=false
119
- dsl.node.children[0].manual_break?.should be_false
117
+ expect(dsl.node.children.size).to eq(1)
118
+ expect(dsl.node.children[0].name).to eq('TabOneLineOne') # not manual_breaking=false
119
+ expect(dsl.node.children[0].manual_break?).to be_falsy
120
120
  end
121
121
  end
122
122
 
123
123
  describe "#add_names" do
124
124
  it "should add a node with o[:name] of o[:node_class] to the node" do
125
- dsl = FactoryGirl.build(:dsl, :node => FactoryGirl.build(:tab, :children => []))
126
- dsl.node.children.should be_empty
125
+ dsl = FactoryBot.build(:dsl, :node => FactoryBot.build(:tab, :children => []))
126
+ expect(dsl.node.children).to be_empty
127
127
 
128
128
  dsl.add_names :names => [:Intro, :Intro], :node_class => Node::Bar
129
129
 
130
- dsl.node.children.should have(2).bars
130
+ expect(dsl.node.children.size).to eq(2)
131
131
  dsl.node.children.each do |child|
132
- child.should be_a(Node::Bar)
133
- child.name.should == :Intro
132
+ expect(child).to be_a(Node::Bar)
133
+ expect(child.name).to eq(:Intro)
134
134
  end
135
135
  end
136
136
 
137
137
  it "should add a node with nil name if the o[:names] is blank" do
138
- dsl = FactoryGirl.build(:dsl, :node => FactoryGirl.build(:tab, :children => []))
139
- dsl.node.children.should be_empty
138
+ dsl = FactoryBot.build(:dsl, :node => FactoryBot.build(:tab, :children => []))
139
+ expect(dsl.node.children).to be_empty
140
140
 
141
141
  dsl.add_names :names => [], :node_class => Node::Bar
142
142
 
143
- dsl.node.children.should have(1).bar
144
- dsl.node.children[0].attributes[:name].should be_nil
145
- dsl.node.children[0].should be_a(Node::Bar)
143
+ expect(dsl.node.children.size).to eq(1)
144
+ expect(dsl.node.children[0].attributes[:name]).to be_nil
145
+ expect(dsl.node.children[0]).to be_a(Node::Bar)
146
146
  end
147
147
 
148
148
  it "should set o[:options] as attributes of the nodes" do
149
- dsl = FactoryGirl.build(:dsl, :node => FactoryGirl.build(:tab, :children => []))
150
- dsl.node.children.should be_empty
149
+ dsl = FactoryBot.build(:dsl, :node => FactoryBot.build(:tab, :children => []))
150
+ expect(dsl.node.children).to be_empty
151
151
 
152
152
  dsl.add_names :names => [:Intro, :Intro], :options => {:value => 1 }, :node_class => Node::Base
153
153
 
154
- dsl.node.children.should have(2).nodes
154
+ expect(dsl.node.children.size).to eq(2)
155
155
  dsl.node.children.each do |child|
156
- child.name.should == :Intro
157
- child.value.should == 1
156
+ expect(child.name).to eq(:Intro)
157
+ expect(child.value).to eq(1)
158
158
  end
159
159
  end
160
160
  end
161
161
 
162
162
  describe "#score" do
163
163
  it "should add a score with the name" do
164
- dsl = FactoryGirl.build(:dsl, :node => FactoryGirl.build(:tab, :children => []))
165
- dsl.node.children.should be_empty
164
+ dsl = FactoryBot.build(:dsl, :node => FactoryBot.build(:tab, :children => []))
165
+ expect(dsl.node.children).to be_empty
166
166
 
167
167
  dsl.score
168
168
 
169
- dsl.node.children.should have(1).score
169
+ expect(dsl.node.children.size).to eq(1)
170
170
 
171
171
  score = dsl.node.children[0]
172
- score.should be_a(Node::Score)
173
- score.children.should be_empty
172
+ expect(score).to be_a(Node::Score)
173
+ expect(score.children).to be_empty
174
174
  end
175
175
 
176
176
  it "should add the definition_children declared in the block to the score" do
177
- dsl = FactoryGirl.build(:dsl, :node => FactoryGirl.build(:tab, :children => []))
178
- dsl.node.children.should be_empty
177
+ dsl = FactoryBot.build(:dsl, :node => FactoryBot.build(:tab, :children => []))
178
+ expect(dsl.node.children).to be_empty
179
179
 
180
- note_set = FactoryGirl.build(:note_set)
180
+ note_set = FactoryBot.build(:note_set)
181
181
 
182
182
  dsl.score do
183
183
  add note_set
184
184
  end
185
185
 
186
- dsl.node.children.should have(1).score
186
+ expect(dsl.node.children.size).to eq(1)
187
187
 
188
188
  score = dsl.node.children[0]
189
- score.children.should have(1).note_set
190
- score.children[0].should == note_set
189
+ expect(score.children.size).to eq(1)
190
+ expect(score.children[0]).to eq(note_set)
191
191
  end
192
192
  end
193
193
 
194
194
  describe "#stanza" do
195
195
  it "should add a stanza with the name" do
196
- dsl = FactoryGirl.build(:dsl, :node => FactoryGirl.build(:tab, :children => []))
197
- dsl.node.children.should be_empty
196
+ dsl = FactoryBot.build(:dsl, :node => FactoryBot.build(:tab, :children => []))
197
+ expect(dsl.node.children).to be_empty
198
198
 
199
199
  dsl.stanza 'Intro'
200
200
 
201
- dsl.node.children.should have(1).stanza
201
+ expect(dsl.node.children.size).to eq(1)
202
202
 
203
203
  stanza = dsl.node.children[0]
204
- stanza.name.should == 'Intro'
205
- stanza.children.should be_empty
204
+ expect(stanza.name).to eq('Intro')
205
+ expect(stanza.children).to be_empty
206
206
  end
207
207
 
208
208
  it "should add the definition_children declared in the block to the stanza" do
209
- dsl = FactoryGirl.build(:dsl, :node => FactoryGirl.build(:tab, :children => []))
210
- dsl.node.children.should be_empty
209
+ dsl = FactoryBot.build(:dsl, :node => FactoryBot.build(:tab, :children => []))
210
+ expect(dsl.node.children).to be_empty
211
211
 
212
- line = FactoryGirl.build(:line)
212
+ line = FactoryBot.build(:line)
213
213
 
214
214
  dsl.stanza 'Intro' do
215
215
  add line
216
216
  end
217
217
 
218
- dsl.node.children.should have(1).stanza
219
- dsl.node.children[0].name.should == 'Intro'
218
+ expect(dsl.node.children.size).to eq(1)
219
+ expect(dsl.node.children[0].name).to eq('Intro')
220
220
 
221
221
  stanza = dsl.node.children[0]
222
- stanza.children.should have(1).line
223
- stanza.children[0].should == line
222
+ expect(stanza.children.size).to eq(1)
223
+ expect(stanza.children[0]).to eq(line)
224
224
  end
225
225
  end
226
226
 
227
227
  [:title, :composer, :arranger, :instrument, :key, :midi_instrument, :string_tunings, :tempo, :transposition].each do |property|
228
228
  describe "##{property}" do
229
229
  it "should set the #{property} of the tab to value" do
230
- tab = FactoryGirl.build(:tab)
230
+ tab = FactoryBot.build(:tab)
231
231
 
232
- dsl = FactoryGirl.build(:dsl, :node => tab)
232
+ dsl = FactoryBot.build(:dsl, :node => tab)
233
233
  dsl.send property, "test"
234
234
 
235
- tab.send(property).should == "test"
235
+ expect(tab.send(property)).to eq("test")
236
236
  end
237
237
  end
238
238
  end
239
239
 
240
240
  describe "#chords" do
241
241
  it "should add a chord set with the name" do
242
- dsl = FactoryGirl.build(:dsl, :node => FactoryGirl.build(:tab, :children => []))
243
- dsl.node.children.should be_empty
242
+ dsl = FactoryBot.build(:dsl, :node => FactoryBot.build(:tab, :children => []))
243
+ expect(dsl.node.children).to be_empty
244
244
 
245
245
  dsl.chords :Am, 'r4-"Am" r r r'
246
246
 
247
- dsl.node.children.should have(1).chord_set
247
+ expect(dsl.node.children.size).to eq(1)
248
248
 
249
249
  chord_set = dsl.node.children[0]
250
- chord_set.name.should == :Am
251
- chord_set.value.should == 'r4-"Am" r r r'
250
+ expect(chord_set.name).to eq(:Am)
251
+ expect(chord_set.value).to eq('r4-"Am" r r r')
252
252
  end
253
253
  end
254
254
 
255
255
  describe "#chords" do
256
256
  it "should add a bar with the name" do
257
- dsl = FactoryGirl.build(:dsl, :node => FactoryGirl.build(:tab, :children => []))
258
- dsl.node.children.should be_empty
257
+ dsl = FactoryBot.build(:dsl, :node => FactoryBot.build(:tab, :children => []))
258
+ expect(dsl.node.children).to be_empty
259
259
 
260
260
  dsl.chords :Am
261
261
 
262
- dsl.node.children.should have(1).chord_set
262
+ expect(dsl.node.children.size).to eq(1)
263
263
 
264
264
  chord_set = dsl.node.children[0]
265
- chord_set.name.should == :Am
265
+ expect(chord_set.name).to eq(:Am)
266
266
  end
267
267
  end
268
268
 
269
269
  describe "#partial" do
270
270
  it "should set the specified duration of the bar node to duration" do
271
- dsl = FactoryGirl.build(:dsl, :node => FactoryGirl.build(:bar))
272
- dsl.node.specified_duration.should be_nil
271
+ dsl = FactoryBot.build(:dsl, :node => FactoryBot.build(:bar))
272
+ expect(dsl.node.specified_duration).to be_nil
273
273
 
274
274
  dsl.partial 8
275
275
 
276
- dsl.node.specified_duration.should == 8
276
+ expect(dsl.node.specified_duration).to eq(8)
277
277
  end
278
278
  end
279
279
 
280
280
  describe "#repeat" do
281
281
  it "should add a repeat with the value" do
282
- dsl = FactoryGirl.build(:dsl, :node => FactoryGirl.build(:tab, :children => []))
282
+ dsl = FactoryBot.build(:dsl, :node => FactoryBot.build(:tab, :children => []))
283
283
 
284
284
  dsl.repeat 2
285
285
 
286
- dsl.node.children.should have(1).repeat
286
+ expect(dsl.node.children.size).to eq(1)
287
287
 
288
288
  repeat = dsl.node.children[0]
289
- repeat.value.should == 2
290
- repeat.children.should be_empty
289
+ expect(repeat.value).to eq(2)
290
+ expect(repeat.children).to be_empty
291
291
  end
292
292
 
293
293
  it "should add the children declared in the block to the repeat" do
294
- dsl = FactoryGirl.build(:dsl, :node => FactoryGirl.build(:tab, :children => []))
294
+ dsl = FactoryBot.build(:dsl, :node => FactoryBot.build(:tab, :children => []))
295
295
 
296
- bar = FactoryGirl.build(:bar)
296
+ bar = FactoryBot.build(:bar)
297
297
 
298
298
  dsl.repeat 2 do
299
299
  add bar
300
300
  end
301
301
 
302
- dsl.node.children.should have(1).repeat
302
+ expect(dsl.node.children.size).to eq(1)
303
303
 
304
304
  repeat = dsl.node.children[0]
305
- repeat.children.should have(1).child
306
- repeat.children[0].should == bar
305
+ expect(repeat.children.size).to eq(1)
306
+ expect(repeat.children[0]).to eq(bar)
307
307
  end
308
308
  end
309
309
 
310
310
  describe "#alternative" do
311
311
  it "should add the children declared in the block to the alternative" do
312
- dsl = FactoryGirl.build(:dsl, :node => FactoryGirl.build(:tab, :children => []))
313
- bar = FactoryGirl.build(:bar)
312
+ dsl = FactoryBot.build(:dsl, :node => FactoryBot.build(:tab, :children => []))
313
+ bar = FactoryBot.build(:bar)
314
314
 
315
315
  dsl.alternative do
316
316
  add bar
317
317
  end
318
318
 
319
- dsl.node.children.should have(1).alternative
319
+ expect(dsl.node.children.size).to eq(1)
320
320
 
321
321
  alternative = dsl.node.children[0]
322
- alternative.children.should have(1).child
323
- alternative.children[0].should == bar
322
+ expect(alternative.children.size).to eq(1)
323
+ expect(alternative.children[0]).to eq(bar)
324
324
  end
325
325
  end
326
326
  end
@@ -3,13 +3,13 @@ require 'spec_helper'
3
3
  describe Gitara::Node::Alternative do
4
4
  describe "#call_value" do
5
5
  it "should be a call to lilypond's alternative command" do
6
- alternative = FactoryGirl.build(:alternative, :children => [
7
- FactoryGirl.build(:bar, :name => 'First'),
8
- FactoryGirl.build(:bar, :name => 'Second')
6
+ alternative = FactoryBot.build(:alternative, :children => [
7
+ FactoryBot.build(:bar, :name => 'First'),
8
+ FactoryBot.build(:bar, :name => 'Second')
9
9
  ])
10
10
 
11
11
  version = Node::Base::NodeVersion.new(:node => alternative)
12
- alternative.call_value(version).should == "\\alternative { { \\nBarFirst } { \\nBarSecond } }"
12
+ expect(alternative.call_value(version)).to eq("\\alternative { { \\nBarFirst } { \\nBarSecond } }")
13
13
  end
14
14
  end
15
15
  end
@@ -3,17 +3,17 @@ require 'spec_helper'
3
3
  describe Gitara::Node::Bar::ChordedVersion do
4
4
  describe "#value" do
5
5
  it "should be the call names of the chord sets in the bar, if available" do
6
- bar = FactoryGirl.build(:bar, :children => [FactoryGirl.build(:chord_set, :name => :Am, :value => 'r-"Am"')])
6
+ bar = FactoryBot.build(:bar, :children => [FactoryBot.build(:chord_set, :name => :Am, :value => 'r-"Am"')])
7
7
 
8
- chorded_bar = FactoryGirl.build(:chorded_bar, :node => bar)
9
- chorded_bar.value.should == '\cChordSetAm'
8
+ chorded_bar = FactoryBot.build(:chorded_bar, :node => bar)
9
+ expect(chorded_bar.value).to eq('\cChordSetAm')
10
10
  end
11
11
 
12
12
  it "should be blank, if the bar does not have any chord sets" do
13
- bar = FactoryGirl.build(:bar, :children => [FactoryGirl.build(:note_set, :value => 'c')])
13
+ bar = FactoryBot.build(:bar, :children => [FactoryBot.build(:note_set, :value => 'c')])
14
14
 
15
- chorded_bar = FactoryGirl.build(:chorded_bar, :node => bar)
16
- chorded_bar.value.should == ""
15
+ chorded_bar = FactoryBot.build(:chorded_bar, :node => bar)
16
+ expect(chorded_bar.value).to eq("")
17
17
  end
18
18
  end
19
19
  end
@@ -3,12 +3,12 @@ require 'spec_helper'
3
3
  describe Gitara::Node::Bar::StanzaVersion do
4
4
  describe "#value" do
5
5
  it "should be the stanza heading of the bar" do
6
- bar = FactoryGirl.build(:bar)
7
- stanza = FactoryGirl.build(:stanza, :name => 'Intro', :children => [bar])
8
- tab = FactoryGirl.build(:tab, :children => [stanza], :time => '4/4')
6
+ bar = FactoryBot.build(:bar)
7
+ stanza = FactoryBot.build(:stanza, :name => 'Intro', :children => [bar])
8
+ tab = FactoryBot.build(:tab, :children => [stanza], :time => '4/4')
9
9
 
10
- stanza_version_of_bar = FactoryGirl.build(:stanza_version_bar, :node => bar)
11
- stanza_version_of_bar.value.should == 'r1'
10
+ stanza_version_of_bar = FactoryBot.build(:stanza_version_bar, :node => bar)
11
+ expect(stanza_version_of_bar.value).to eq('r1')
12
12
  end
13
13
  end
14
14
  end
@@ -3,14 +3,14 @@ require 'spec_helper'
3
3
  describe Gitara::Node::Bar::VoicedVersion do
4
4
  describe "#matching_note_set" do
5
5
  it "should be the note_set matching this voiced bar" do
6
- note_set = FactoryGirl.build(:note_set)
6
+ note_set = FactoryBot.build(:note_set)
7
7
 
8
- bar = FactoryGirl.build(:bar, :children => [note_set])
8
+ bar = FactoryBot.build(:bar, :children => [note_set])
9
9
 
10
- voice = FactoryGirl.build(:voice, :id => 1)
10
+ voice = FactoryBot.build(:voice, :id => 1)
11
11
 
12
- voiced_bar = FactoryGirl.build(:voiced_bar, :node => bar, :voice => voice)
13
- voiced_bar.matching_note_set.should == note_set
12
+ voiced_bar = FactoryBot.build(:voiced_bar, :node => bar, :voice => voice)
13
+ expect(voiced_bar.matching_note_set).to eq(note_set)
14
14
  end
15
15
  end
16
16
  end
@@ -3,50 +3,50 @@ require 'spec_helper'
3
3
  describe Gitara::Node::Bar do
4
4
  describe "#note_sets" do
5
5
  it "should be the note sets of its definition" do
6
- definition_bar = FactoryGirl.build(:bar, :name => 'Intro').tap {|bar|
6
+ definition_bar = FactoryBot.build(:bar, :name => 'Intro').tap {|bar|
7
7
  bar.children = [
8
- FactoryGirl.build(:note_set),
9
- FactoryGirl.build(:note_set)
8
+ FactoryBot.build(:note_set),
9
+ FactoryBot.build(:note_set)
10
10
  ]
11
11
  }
12
12
 
13
- call_bar = FactoryGirl.build(:bar, :name => 'Intro', :children => [])
13
+ call_bar = FactoryBot.build(:bar, :name => 'Intro', :children => [])
14
14
 
15
- tab = FactoryGirl.build(:tab, :children => [definition_bar, call_bar])
15
+ tab = FactoryBot.build(:tab, :children => [definition_bar, call_bar])
16
16
 
17
- call_bar.note_sets.should have(2).note_sets
17
+ expect(call_bar.note_sets.size).to eq(2)
18
18
  end
19
19
  end
20
20
 
21
21
  describe "#stanza_heading" do
22
22
  it "should be a whole rest with no stanza name" do
23
- first_bar = FactoryGirl.build(:bar)
24
- second_bar = FactoryGirl.build(:bar)
25
- stanza = FactoryGirl.build(:stanza, :name => 'Intro', :children => [first_bar, second_bar])
26
- tab = FactoryGirl.build(:tab, :children => [stanza], :time => '4/4')
23
+ first_bar = FactoryBot.build(:bar)
24
+ second_bar = FactoryBot.build(:bar)
25
+ stanza = FactoryBot.build(:stanza, :name => 'Intro', :children => [first_bar, second_bar])
26
+ tab = FactoryBot.build(:tab, :children => [stanza], :time => '4/4')
27
27
 
28
- second_bar.stanza_heading.should == 'r1'
28
+ expect(second_bar.stanza_heading).to eq('r1')
29
29
  end
30
30
 
31
31
  it "should be a partial with no stanza name if the bar has a special_duration" do
32
- first_bar = FactoryGirl.build(:bar)
33
- second_bar = FactoryGirl.build(:bar, :specified_duration => 8)
34
- stanza = FactoryGirl.build(:stanza, :name => 'Intro', :children => [first_bar, second_bar])
35
- tab = FactoryGirl.build(:tab, :children => [stanza], :time => '4/4')
32
+ first_bar = FactoryBot.build(:bar)
33
+ second_bar = FactoryBot.build(:bar, :specified_duration => 8)
34
+ stanza = FactoryBot.build(:stanza, :name => 'Intro', :children => [first_bar, second_bar])
35
+ tab = FactoryBot.build(:tab, :children => [stanza], :time => '4/4')
36
36
 
37
- second_bar.stanza_heading.should == 'r8'
37
+ expect(second_bar.stanza_heading).to eq('r8')
38
38
  end
39
39
  end
40
40
 
41
41
  describe "#specified_duration_as_lilypond" do
42
42
  it "should be \\partial specified_duration if present" do
43
- bar = FactoryGirl.build(:bar, :specified_duration => 8)
44
- bar.specified_duration_as_lilypond.should == '\partial 8'
43
+ bar = FactoryBot.build(:bar, :specified_duration => 8)
44
+ expect(bar.specified_duration_as_lilypond).to eq('\partial 8')
45
45
  end
46
46
 
47
47
  it "should be nil if there is no specified_duration" do
48
- bar = FactoryGirl.build(:bar, :specified_duration => nil)
49
- bar.specified_duration_as_lilypond.should be_nil
48
+ bar = FactoryBot.build(:bar, :specified_duration => nil)
49
+ expect(bar.specified_duration_as_lilypond).to be_nil
50
50
  end
51
51
  end
52
52
  end