metasploit-model 0.30.2 → 1.0.0.pre.rails.pre.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec +4 -2
- data/CONTRIBUTING.md +49 -9
- data/Gemfile +8 -3
- data/lib/metasploit/model.rb +5 -0
- data/lib/metasploit/model/engine.rb +1 -1
- data/lib/metasploit/model/version.rb +14 -26
- data/metasploit-model.gemspec +5 -3
- data/spec/app/models/metasploit/model/association/reflection_spec.rb +7 -5
- data/spec/app/models/metasploit/model/search/group/base_spec.rb +4 -2
- data/spec/app/models/metasploit/model/search/group/intersection_spec.rb +4 -2
- data/spec/app/models/metasploit/model/search/group/union_spec.rb +4 -2
- data/spec/app/models/metasploit/model/search/operation/association_spec.rb +9 -7
- data/spec/app/models/metasploit/model/search/operation/base_spec.rb +7 -5
- data/spec/app/models/metasploit/model/search/operation/boolean_spec.rb +11 -14
- data/spec/app/models/metasploit/model/search/operation/date_spec.rb +8 -6
- data/spec/app/models/metasploit/model/search/operation/group/base_spec.rb +14 -12
- data/spec/app/models/metasploit/model/search/operation/group/intersection_spec.rb +4 -2
- data/spec/app/models/metasploit/model/search/operation/group/union_spec.rb +4 -2
- data/spec/app/models/metasploit/model/search/operation/integer_spec.rb +4 -2
- data/spec/app/models/metasploit/model/search/operation/null_spec.rb +6 -4
- data/spec/app/models/metasploit/model/search/operation/set/integer_spec.rb +4 -2
- data/spec/app/models/metasploit/model/search/operation/set/string_spec.rb +4 -2
- data/spec/app/models/metasploit/model/search/operation/set_spec.rb +6 -4
- data/spec/app/models/metasploit/model/search/operation/string_spec.rb +4 -2
- data/spec/app/models/metasploit/model/search/operator/association_spec.rb +8 -6
- data/spec/app/models/metasploit/model/search/operator/attribute_spec.rb +14 -12
- data/spec/app/models/metasploit/model/search/operator/base_spec.rb +5 -3
- data/spec/app/models/metasploit/model/search/operator/delegation_spec.rb +11 -13
- data/spec/app/models/metasploit/model/search/operator/group/base_spec.rb +7 -5
- data/spec/app/models/metasploit/model/search/operator/group/intersection_spec.rb +5 -3
- data/spec/app/models/metasploit/model/search/operator/group/union_spec.rb +5 -3
- data/spec/app/models/metasploit/model/search/operator/null_spec.rb +7 -5
- data/spec/app/models/metasploit/model/search/operator/single_spec.rb +28 -26
- data/spec/app/models/metasploit/model/search/query_spec.rb +50 -48
- data/spec/app/models/metasploit/model/visitation/visitor_spec.rb +9 -7
- data/spec/app/validators/ip_format_validator_spec.rb +9 -7
- data/spec/app/validators/nil_validator_spec.rb +5 -3
- data/spec/app/validators/parameters_validator_spec.rb +29 -29
- data/spec/app/validators/password_is_strong_validator_spec.rb +19 -17
- data/spec/dummy/config/application.rb +3 -1
- data/spec/dummy/config/environments/development.rb +0 -3
- data/spec/lib/metasploit/model/association/error_spec.rb +3 -1
- data/spec/lib/metasploit/model/association_spec.rb +10 -8
- data/spec/lib/metasploit/model/base_spec.rb +5 -3
- data/spec/lib/metasploit/model/engine_spec.rb +11 -48
- data/spec/lib/metasploit/model/file_spec.rb +5 -3
- data/spec/lib/metasploit/model/invalid_spec.rb +9 -7
- data/spec/lib/metasploit/model/login/status_spec.rb +3 -1
- data/spec/lib/metasploit/model/nilify_blanks_spec.rb +13 -11
- data/spec/lib/metasploit/model/realm/key_spec.rb +17 -15
- data/spec/lib/metasploit/model/search/association/tree_spec.rb +5 -3
- data/spec/lib/metasploit/model/search/association_spec.rb +4 -2
- data/spec/lib/metasploit/model/search/attribute_spec.rb +8 -6
- data/spec/lib/metasploit/model/search/operation/value/integer_spec.rb +3 -1
- data/spec/lib/metasploit/model/search/operation/value/string_spec.rb +3 -1
- data/spec/lib/metasploit/model/search/operation_spec.rb +13 -11
- data/spec/lib/metasploit/model/search/operator/help_spec.rb +3 -1
- data/spec/lib/metasploit/model/search/with_spec.rb +9 -7
- data/spec/lib/metasploit/model/search_spec.rb +13 -11
- data/spec/lib/metasploit/model/spec/error_spec.rb +4 -2
- data/spec/lib/metasploit/model/spec/i18n_exception_handler_spec.rb +7 -5
- data/spec/lib/metasploit/model/spec/pathname_collision_spec.rb +6 -4
- data/spec/lib/metasploit/model/spec_spec.rb +7 -9
- data/spec/lib/metasploit/model/translation_spec.rb +12 -10
- data/spec/lib/metasploit/model/version_spec.rb +139 -3
- data/spec/lib/metasploit/model/visitation/visit_spec.rb +26 -28
- data/spec/matchers/validate_nilness_of_spec.rb +2 -0
- data/spec/spec_helper.rb +10 -80
- data/spec/support/shared/contexts/metasploit/model/search/operator/union/children.rb +1 -1
- data/spec/support/shared/examples/metasploit/model/search/operation/value/integer.rb +8 -8
- data/spec/support/shared/examples/metasploit/model/search/operation/value/string.rb +5 -5
- data/spec/support/shared/examples/metasploit/model/search/operator/help.rb +16 -18
- data/spec/support/shared/examples/metasploit/model/translation.rb +4 -4
- data/spec/support/shared/examples/search/query.rb +3 -3
- data/spec/support/shared/examples/search_association.rb +2 -2
- data/spec/support/shared/examples/search_attribute.rb +3 -3
- data/spec/support/shared/examples/search_with.rb +3 -3
- metadata +20 -27
- data/CHANGELOG.md +0 -6
- data/RELEASING.md +0 -86
- data/UPGRADING.md +0 -1
- data/spec/lib/metasploit/model_spec.rb +0 -4
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Metasploit::Model::Search::Operation::Date do
|
2
4
|
context 'validation' do
|
3
5
|
context 'value' do
|
4
6
|
before(:each) do
|
@@ -23,7 +25,7 @@ RSpec.describe Metasploit::Model::Search::Operation::Date, type: :model do
|
|
23
25
|
end
|
24
26
|
|
25
27
|
it 'should not record error' do
|
26
|
-
|
28
|
+
errors.should_not include(error)
|
27
29
|
end
|
28
30
|
end
|
29
31
|
|
@@ -33,7 +35,7 @@ RSpec.describe Metasploit::Model::Search::Operation::Date, type: :model do
|
|
33
35
|
end
|
34
36
|
|
35
37
|
it 'should record error' do
|
36
|
-
|
38
|
+
errors.should include(error)
|
37
39
|
end
|
38
40
|
end
|
39
41
|
end
|
@@ -54,7 +56,7 @@ RSpec.describe Metasploit::Model::Search::Operation::Date, type: :model do
|
|
54
56
|
end
|
55
57
|
|
56
58
|
it 'should be passed in Date' do
|
57
|
-
|
59
|
+
value.should == formatted_value
|
58
60
|
end
|
59
61
|
end
|
60
62
|
|
@@ -69,7 +71,7 @@ RSpec.describe Metasploit::Model::Search::Operation::Date, type: :model do
|
|
69
71
|
end
|
70
72
|
|
71
73
|
it 'should be parsed Date' do
|
72
|
-
|
74
|
+
value.should == date
|
73
75
|
end
|
74
76
|
end
|
75
77
|
|
@@ -79,7 +81,7 @@ RSpec.describe Metasploit::Model::Search::Operation::Date, type: :model do
|
|
79
81
|
end
|
80
82
|
|
81
83
|
it 'should pass through value' do
|
82
|
-
|
84
|
+
value.should be formatted_value
|
83
85
|
end
|
84
86
|
end
|
85
87
|
end
|
@@ -1,13 +1,15 @@
|
|
1
|
-
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Metasploit::Model::Search::Operation::Group::Base do
|
2
4
|
subject(:group) do
|
3
5
|
described_class.new
|
4
6
|
end
|
5
7
|
|
6
|
-
it {
|
8
|
+
it { should be_a Metasploit::Model::Search::Operation::Base }
|
7
9
|
|
8
10
|
context 'validations' do
|
9
11
|
context 'children' do
|
10
|
-
it {
|
12
|
+
it { should ensure_length_of(:children).is_at_least(1).with_short_message('is too short (minimum is 1 child)') }
|
11
13
|
|
12
14
|
context '#children_valid' do
|
13
15
|
subject(:children_valid) do
|
@@ -46,25 +48,25 @@ RSpec.describe Metasploit::Model::Search::Operation::Group::Base, type: :model d
|
|
46
48
|
context 'with all valid' do
|
47
49
|
before(:each) do
|
48
50
|
children.each do |child|
|
49
|
-
|
51
|
+
child.stub(valid?: true)
|
50
52
|
end
|
51
53
|
end
|
52
54
|
|
53
55
|
it 'does not add error on :children' do
|
54
56
|
group.valid?
|
55
57
|
|
56
|
-
|
58
|
+
group.errors[:children].should_not include(error)
|
57
59
|
end
|
58
60
|
end
|
59
61
|
|
60
62
|
context 'with later valid' do
|
61
63
|
before(:each) do
|
62
|
-
|
63
|
-
|
64
|
+
children.first.stub(valid?: false)
|
65
|
+
children.second.stub(valid?: true)
|
64
66
|
end
|
65
67
|
|
66
68
|
it 'does not short-circuit and validates all children' do
|
67
|
-
|
69
|
+
children.second.should_receive(:valid?).and_return(true)
|
68
70
|
|
69
71
|
children_valid
|
70
72
|
end
|
@@ -72,7 +74,7 @@ RSpec.describe Metasploit::Model::Search::Operation::Group::Base, type: :model d
|
|
72
74
|
it 'should add error on :children' do
|
73
75
|
group.valid?
|
74
76
|
|
75
|
-
|
77
|
+
group.errors[:children].should include(error)
|
76
78
|
end
|
77
79
|
end
|
78
80
|
end
|
@@ -85,7 +87,7 @@ RSpec.describe Metasploit::Model::Search::Operation::Group::Base, type: :model d
|
|
85
87
|
it 'does not add error on :children' do
|
86
88
|
group.valid?
|
87
89
|
|
88
|
-
|
90
|
+
group.errors[:children].should_not include(error)
|
89
91
|
end
|
90
92
|
end
|
91
93
|
end
|
@@ -98,7 +100,7 @@ RSpec.describe Metasploit::Model::Search::Operation::Group::Base, type: :model d
|
|
98
100
|
end
|
99
101
|
|
100
102
|
context 'default' do
|
101
|
-
it {
|
103
|
+
it { should == [] }
|
102
104
|
end
|
103
105
|
|
104
106
|
context 'with attribute' do
|
@@ -115,7 +117,7 @@ RSpec.describe Metasploit::Model::Search::Operation::Group::Base, type: :model d
|
|
115
117
|
end
|
116
118
|
|
117
119
|
it 'is the value passed with :children to #new' do
|
118
|
-
|
120
|
+
children.should == expected_children
|
119
121
|
end
|
120
122
|
end
|
121
123
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Metasploit::Model::Search::Operation::Group::Intersection do
|
4
|
+
it { should be_a Metasploit::Model::Search::Operation::Group::Base }
|
3
5
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Metasploit::Model::Search::Operation::Group::Union do
|
4
|
+
it { should be_a Metasploit::Model::Search::Operation::Group::Base }
|
3
5
|
end
|
@@ -1,6 +1,8 @@
|
|
1
|
-
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Metasploit::Model::Search::Operation::Integer do
|
2
4
|
context 'validation' do
|
3
|
-
it {
|
5
|
+
it { should validate_numericality_of(:value).only_integer }
|
4
6
|
end
|
5
7
|
|
6
8
|
it_should_behave_like 'Metasploit::Model::Search::Operation::Value::Integer'
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Metasploit::Model::Search::Operation::Null do
|
2
4
|
context 'validation' do
|
3
5
|
context 'operator' do
|
4
6
|
context 'null' do
|
@@ -39,7 +41,7 @@ RSpec.describe Metasploit::Model::Search::Operation::Null, type: :model do
|
|
39
41
|
end
|
40
42
|
|
41
43
|
it 'should not record error' do
|
42
|
-
|
44
|
+
errors.should_not include(error)
|
43
45
|
end
|
44
46
|
end
|
45
47
|
|
@@ -49,11 +51,11 @@ RSpec.describe Metasploit::Model::Search::Operation::Null, type: :model do
|
|
49
51
|
end
|
50
52
|
|
51
53
|
it 'should record error' do
|
52
|
-
|
54
|
+
errors.should include(error)
|
53
55
|
end
|
54
56
|
|
55
57
|
it 'should have no other errors, so that it would be valid without this type check on operator' do
|
56
|
-
|
58
|
+
operation.errors.size.should == 1
|
57
59
|
end
|
58
60
|
end
|
59
61
|
end
|
@@ -1,5 +1,7 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Metasploit::Model::Search::Operation::Set::Integer do
|
4
|
+
it { should be_a Metasploit::Model::Search::Operation::Set }
|
3
5
|
|
4
6
|
it_should_behave_like 'Metasploit::Model::Search::Operation::Value::Integer'
|
5
7
|
end
|
@@ -1,5 +1,7 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Metasploit::Model::Search::Operation::Set::String do
|
4
|
+
it { should be_a Metasploit::Model::Search::Operation::Set }
|
3
5
|
|
4
6
|
it_should_behave_like 'Metasploit::Model::Search::Operation::Value::String'
|
5
7
|
end
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Metasploit::Model::Search::Operation::Set do
|
2
4
|
subject(:set) do
|
3
5
|
described_class.new(
|
4
6
|
operator: operator,
|
@@ -95,7 +97,7 @@ RSpec.describe Metasploit::Model::Search::Operation::Set, type: :model do
|
|
95
97
|
attribute_set.sample
|
96
98
|
end
|
97
99
|
|
98
|
-
it {
|
100
|
+
it { should_not include(error) }
|
99
101
|
end
|
100
102
|
|
101
103
|
context 'without value in attribute_set' do
|
@@ -103,7 +105,7 @@ RSpec.describe Metasploit::Model::Search::Operation::Set, type: :model do
|
|
103
105
|
:not_an_member
|
104
106
|
end
|
105
107
|
|
106
|
-
it {
|
108
|
+
it { should include(error) }
|
107
109
|
end
|
108
110
|
end
|
109
111
|
|
@@ -116,7 +118,7 @@ RSpec.describe Metasploit::Model::Search::Operation::Set, type: :model do
|
|
116
118
|
nil
|
117
119
|
end
|
118
120
|
|
119
|
-
it {
|
121
|
+
it { should_not include(error) }
|
120
122
|
end
|
121
123
|
end
|
122
124
|
end
|
@@ -1,6 +1,8 @@
|
|
1
|
-
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Metasploit::Model::Search::Operation::String do
|
2
4
|
context 'validation' do
|
3
|
-
it {
|
5
|
+
it { should validate_presence_of(:value) }
|
4
6
|
end
|
5
7
|
|
6
8
|
it_should_behave_like 'Metasploit::Model::Search::Operation::Value::String'
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Metasploit::Model::Search::Operator::Association do
|
2
4
|
subject(:operator) do
|
3
5
|
described_class.new(
|
4
6
|
:association => association,
|
@@ -14,11 +16,11 @@ RSpec.describe Metasploit::Model::Search::Operator::Association, type: :model do
|
|
14
16
|
double('Metasploit::Model::Search::Operator::Base')
|
15
17
|
end
|
16
18
|
|
17
|
-
it {
|
19
|
+
it { should be_a Metasploit::Model::Search::Operator::Base }
|
18
20
|
|
19
21
|
context 'validations' do
|
20
|
-
it {
|
21
|
-
it {
|
22
|
+
it { should validate_presence_of(:association) }
|
23
|
+
it { should validate_presence_of(:source_operator) }
|
22
24
|
end
|
23
25
|
|
24
26
|
context '#help' do
|
@@ -49,7 +51,7 @@ RSpec.describe Metasploit::Model::Search::Operator::Association, type: :model do
|
|
49
51
|
'source_operator_name'
|
50
52
|
}
|
51
53
|
|
52
|
-
it {
|
54
|
+
it { should be_a Symbol }
|
53
55
|
|
54
56
|
it 'should be <association>.<source_operator.name>' do
|
55
57
|
expect(name).to eq :"#{association}.#{source_operator_name}"
|
@@ -79,7 +81,7 @@ RSpec.describe Metasploit::Model::Search::Operator::Association, type: :model do
|
|
79
81
|
}
|
80
82
|
}
|
81
83
|
|
82
|
-
it {
|
84
|
+
it { should be_a Metasploit::Model::Search::Operation::Association }
|
83
85
|
|
84
86
|
context 'Metasploit::Model::Search::Operation::Association' do
|
85
87
|
context '#operator' do
|
@@ -1,5 +1,7 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Metasploit::Model::Search::Operator::Attribute do
|
4
|
+
it { should be_a Metasploit::Model::Search::Operator::Single }
|
3
5
|
|
4
6
|
context 'CONSTANTS' do
|
5
7
|
context 'TYPES' do
|
@@ -7,30 +9,30 @@ RSpec.describe Metasploit::Model::Search::Operator::Attribute, type: :model do
|
|
7
9
|
described_class::TYPES
|
8
10
|
end
|
9
11
|
|
10
|
-
it {
|
11
|
-
it {
|
12
|
+
it { should include(:boolean) }
|
13
|
+
it { should include(:date) }
|
12
14
|
it {
|
13
|
-
|
15
|
+
should include(
|
14
16
|
{
|
15
17
|
set: :integer
|
16
18
|
}
|
17
19
|
)
|
18
20
|
}
|
19
21
|
it {
|
20
|
-
|
22
|
+
should include(
|
21
23
|
{
|
22
24
|
set: :string
|
23
25
|
}
|
24
26
|
)
|
25
27
|
}
|
26
|
-
it {
|
27
|
-
it {
|
28
|
+
it { should include(:integer) }
|
29
|
+
it { should include(:string) }
|
28
30
|
end
|
29
31
|
end
|
30
32
|
|
31
33
|
context 'validations' do
|
32
|
-
it {
|
33
|
-
it {
|
34
|
+
it { should validate_presence_of(:attribute) }
|
35
|
+
it { should validate_inclusion_of(:type).in_array(described_class::TYPES) }
|
34
36
|
end
|
35
37
|
|
36
38
|
context '#attribute_enumerable' do
|
@@ -75,7 +77,7 @@ RSpec.describe Metasploit::Model::Search::Operator::Attribute, type: :model do
|
|
75
77
|
end
|
76
78
|
|
77
79
|
it 'should be #klass #<attribute>_set' do
|
78
|
-
|
80
|
+
attribute_set.should == expected_attribute_set
|
79
81
|
end
|
80
82
|
end
|
81
83
|
end
|
@@ -96,7 +98,7 @@ RSpec.describe Metasploit::Model::Search::Operator::Attribute, type: :model do
|
|
96
98
|
end
|
97
99
|
|
98
100
|
it 'should be #attribute' do
|
99
|
-
|
101
|
+
name.should == attribute
|
100
102
|
end
|
101
103
|
end
|
102
104
|
end
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Metasploit::Model::Search::Operator::Base do
|
2
4
|
subject(:operator) do
|
3
5
|
described_class.new
|
4
6
|
end
|
@@ -10,12 +12,12 @@ RSpec.describe Metasploit::Model::Search::Operator::Base, type: :model do
|
|
10
12
|
|
11
13
|
before(:each) do
|
12
14
|
# have to stub since it's not implemented on base
|
13
|
-
|
15
|
+
operator.stub(name: name)
|
14
16
|
end
|
15
17
|
end
|
16
18
|
|
17
19
|
context 'validations' do
|
18
|
-
it {
|
20
|
+
it { should validate_presence_of(:klass) }
|
19
21
|
end
|
20
22
|
|
21
23
|
context '#name' do
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Metasploit::Model::Search::Operator::Delegation do
|
2
4
|
subject(:operator) do
|
3
5
|
described_class.new(
|
4
6
|
:klass => klass
|
@@ -9,7 +11,7 @@ RSpec.describe Metasploit::Model::Search::Operator::Delegation, type: :model do
|
|
9
11
|
Class.new
|
10
12
|
end
|
11
13
|
|
12
|
-
it {
|
14
|
+
it { should be_a Metasploit::Model::Search::Operator::Base }
|
13
15
|
|
14
16
|
context 'operator_name' do
|
15
17
|
subject(:operator_name) do
|
@@ -30,7 +32,7 @@ RSpec.describe Metasploit::Model::Search::Operator::Delegation, type: :model do
|
|
30
32
|
end
|
31
33
|
|
32
34
|
it 'should remove namespace' do
|
33
|
-
|
35
|
+
operator_name.should == base_name.downcase.to_sym
|
34
36
|
end
|
35
37
|
end
|
36
38
|
|
@@ -40,7 +42,7 @@ RSpec.describe Metasploit::Model::Search::Operator::Delegation, type: :model do
|
|
40
42
|
end
|
41
43
|
|
42
44
|
it 'should convert name to underscore' do
|
43
|
-
|
45
|
+
operator_name.should == :camel_case
|
44
46
|
end
|
45
47
|
end
|
46
48
|
end
|
@@ -65,21 +67,17 @@ RSpec.describe Metasploit::Model::Search::Operator::Delegation, type: :model do
|
|
65
67
|
end
|
66
68
|
|
67
69
|
before(:each) do
|
68
|
-
|
69
|
-
|
70
|
-
klass.send(:define_singleton_method, :search_operator_by_name) do
|
71
|
-
outer_search_operator_by_name
|
72
|
-
end
|
70
|
+
klass.stub(:search_operator_by_name => search_operator_by_name)
|
73
71
|
end
|
74
72
|
|
75
73
|
it 'should convert formatted_operator to Symbol' do
|
76
|
-
|
74
|
+
formatted_operator.should_receive(:to_sym)
|
77
75
|
|
78
76
|
named_operator
|
79
77
|
end
|
80
78
|
|
81
79
|
it 'should look up operator name in search_operator_by_name of #klass' do
|
82
|
-
|
80
|
+
named_operator.should == search_operator
|
83
81
|
end
|
84
82
|
|
85
83
|
context 'with name not in klass.search_operator_by_name' do
|
@@ -102,9 +100,9 @@ RSpec.describe Metasploit::Model::Search::Operator::Delegation, type: :model do
|
|
102
100
|
|
103
101
|
it 'should delegate to operator_name' do
|
104
102
|
operator_name = double('Operator Name')
|
105
|
-
|
103
|
+
operator.class.stub(:operator_name => operator_name)
|
106
104
|
|
107
|
-
|
105
|
+
name.should == operator_name
|
108
106
|
end
|
109
107
|
end
|
110
108
|
end
|