rley 0.0.04 → 0.0.05

Sign up to get free protection for your applications and to get access to all the features.
@@ -7,58 +7,57 @@ require_relative '../../../lib/rley/syntax/symbol_seq'
7
7
 
8
8
  module Rley # Open this namespace to avoid module qualifier prefixes
9
9
  module Syntax # Open this namespace to avoid module qualifier prefixes
10
-
11
- describe SymbolSeq do
12
- let(:verb) { NonTerminal.new('Verb') }
13
- let(:np) { NonTerminal.new('NP') }
14
- let(:pp) { NonTerminal.new('PP') }
15
-
16
- # Default instantiation rule
17
- subject { SymbolSeq.new([verb, np, pp]) }
18
-
19
- context 'Initialization:' do
20
- it 'should be created with a list of symbols' do
21
- # Case of non-empty sequence
22
- expect { SymbolSeq.new([verb, np, pp]) }.not_to raise_error
23
-
24
- # Case of empty sequence
25
- expect { SymbolSeq.new([]) }.not_to raise_error
26
- end
27
-
28
- it 'should know its members' do
29
- expect(subject.members).to eq([verb, np, pp])
30
- end
31
-
32
- it 'should know whether it is empty' do
33
- expect(subject).not_to be_empty
34
- instance = SymbolSeq.new([])
35
- expect(instance).to be_empty
36
- end
37
-
38
- it 'should the count of its members' do
39
- expect(subject.size).to eq(3)
40
- end
41
- end # context
42
-
43
- context 'Provided services:' do
44
- it 'should compare compare with itself' do
45
- expect(subject == subject).to eq(true)
46
- end
47
-
48
- it 'should compare with another instance' do
49
- empty_one = SymbolSeq.new([])
50
- expect(subject == empty_one).not_to eq(true)
51
-
52
- equal_one = SymbolSeq.new([verb, np, pp])
53
- expect(subject == equal_one).to eq(true)
54
-
55
- unequal_one = SymbolSeq.new([verb, pp, np])
56
- expect(subject == unequal_one).not_to eq(true)
57
- end
58
- end # context
59
-
60
- end # describe
61
-
10
+ describe SymbolSeq do
11
+ let(:verb) { NonTerminal.new('Verb') }
12
+ let(:np) { NonTerminal.new('NP') }
13
+ let(:pp) { NonTerminal.new('PP') }
14
+
15
+ # Default instantiation rule
16
+ subject { SymbolSeq.new([verb, np, pp]) }
17
+
18
+ context 'Initialization:' do
19
+ it 'should be created with a list of symbols' do
20
+ # Case of non-empty sequence
21
+ expect { SymbolSeq.new([verb, np, pp]) }.not_to raise_error
22
+
23
+ # Case of empty sequence
24
+ expect { SymbolSeq.new([]) }.not_to raise_error
25
+ end
26
+
27
+ it 'should know its members' do
28
+ expect(subject.members).to eq([verb, np, pp])
29
+ end
30
+
31
+ it 'should know whether it is empty' do
32
+ expect(subject).not_to be_empty
33
+ instance = SymbolSeq.new([])
34
+ expect(instance).to be_empty
35
+ end
36
+
37
+ it 'should the count of its members' do
38
+ expect(subject.size).to eq(3)
39
+ end
40
+ end # context
41
+
42
+ context 'Provided services:' do
43
+ it 'should compare compare with itself' do
44
+ me = subject
45
+ expect(subject == me).to eq(true)
46
+ end
47
+
48
+ it 'should compare with another instance' do
49
+ empty_one = SymbolSeq.new([])
50
+ expect(subject == empty_one).not_to eq(true)
51
+
52
+ equal_one = SymbolSeq.new([verb, np, pp])
53
+ expect(subject == equal_one).to eq(true)
54
+
55
+ unequal_one = SymbolSeq.new([verb, pp, np])
56
+ expect(subject == unequal_one).not_to eq(true)
57
+ end
58
+ end # context
59
+
60
+ end # describe
62
61
  end # module
63
62
  end # module
64
63
 
@@ -5,25 +5,22 @@ require_relative '../../../lib/rley/syntax/terminal'
5
5
 
6
6
  module Rley # Open this namespace to avoid module qualifier prefixes
7
7
  module Syntax # Open this namespace to avoid module qualifier prefixes
8
+ describe Terminal do
9
+ let(:sample_name) { 'noun' }
10
+ subject { Terminal.new(sample_name) }
8
11
 
9
- describe Terminal do
10
- let(:sample_name) { 'noun' }
11
- subject { Terminal.new(sample_name) }
12
+ context 'Initialization:' do
13
+ it 'should be created with a name' do
14
+ expect { Terminal.new('noun') }.not_to raise_error
15
+ end
12
16
 
13
- context 'Initialization:' do
14
- it 'should be created with a name' do
15
- expect { Terminal.new('noun') }.not_to raise_error
16
- end
17
-
18
- it 'should know its name' do
19
- expect(subject.name).to eq(sample_name)
20
- end
21
- end # context
22
-
23
- end # describe
17
+ it 'should know its name' do
18
+ expect(subject.name).to eq(sample_name)
19
+ end
20
+ end # context
24
21
 
22
+ end # describe
25
23
  end # module
26
24
  end # module
27
25
 
28
26
  # End of file
29
-
@@ -5,28 +5,26 @@ require_relative '../../../lib/rley/syntax/verbatim_symbol'
5
5
 
6
6
  module Rley # Open this namespace to avoid module qualifier prefixes
7
7
  module Syntax # Open this namespace to avoid module qualifier prefixes
8
+ describe VerbatimSymbol do
9
+ let(:sample_name) { 'cheapest' }
10
+ subject { VerbatimSymbol.new(sample_name) }
8
11
 
9
- describe VerbatimSymbol do
10
- let(:sample_name) { 'cheapest' }
11
- subject { VerbatimSymbol.new(sample_name) }
12
+ context 'Initialization:' do
13
+ it 'should be created with a word' do
14
+ expect { VerbatimSymbol.new('cheapest') }.not_to raise_error
15
+ end
12
16
 
13
- context 'Initialization:' do
14
- it 'should be created with a word' do
15
- expect { VerbatimSymbol.new('cheapest') }.not_to raise_error
16
- end
17
+ it 'should know its name' do
18
+ expect(subject.name).to eq(sample_name)
19
+ end
17
20
 
18
- it 'should know its name' do
19
- expect(subject.name).to eq(sample_name)
20
- end
21
-
22
- it 'should know its text representation' do
23
- expect(subject.text).to eq(sample_name)
24
- end
25
- end # context
26
-
27
- end # describe
21
+ it 'should know its text representation' do
22
+ expect(subject.text).to eq(sample_name)
23
+ end
24
+ end # context
28
25
 
26
+ end # describe
29
27
  end # module
30
28
  end # module
31
29
 
32
- # End of file
30
+ # End of file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rley
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.04
4
+ version: 0.0.05
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dimitri Geshef
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-12 00:00:00.000000000 Z
11
+ date: 2014-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake