This repository was archived by the owner on Nov 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathmethods_spec.rb
More file actions
62 lines (43 loc) · 1.44 KB
/
methods_spec.rb
File metadata and controls
62 lines (43 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
require 'spec_helper'
require 'dredd_hooks/methods'
module DreddHooks
class DummyHooksFile
include DreddHooks::Methods
end
describe Methods do
let(:hooks_file) { DummyHooksFile.new }
describe 'exposes the Ruby hooks DSL', public: true do
it 'defines #before' do
expect(hooks_file).to respond_to :before
end
it 'defines #before_validation' do
expect(hooks_file).to respond_to :before_validation
end
it 'defines #after' do
expect(hooks_file).to respond_to :after
end
it 'defines #before_each' do
expect(hooks_file).to respond_to :before_each
end
it 'defines #before_each_validation' do
expect(hooks_file).to respond_to :before_each_validation
end
it 'defines #after_each' do
expect(hooks_file).to respond_to :after_each
end
it 'defines #before_all' do
expect(hooks_file).to respond_to :before_all
end
it 'defines #after_all' do
expect(hooks_file).to respond_to :after_all
end
end
it 'does not expose its #runner', private: true do
expect(hooks_file).not_to respond_to :runner
end
describe 'does not expose its generator methods', private: true do
it { expect(DreddHooks::Methods).not_to respond_to :define_hooks_on_multiple_transactions }
it { expect(DreddHooks::Methods).not_to respond_to :define_hooks_on_single_transactions }
end
end
end