|
7 | 7 | end |
8 | 8 |
|
9 | 9 | it 'provides defaults' do |
10 | | - Griddler.configuration.processor_class.should eq(EmailProcessor) |
11 | | - Griddler.configuration.reply_delimiter.should eq('Reply ABOVE THIS LINE') |
12 | | - Griddler.configuration.email_service.should eq(:test_adapter) |
13 | | - Griddler.configuration.processor_method.should eq(:process) |
| 10 | + expect(Griddler.configuration.processor_class).to eq(EmailProcessor) |
| 11 | + expect(Griddler.configuration.reply_delimiter).to eq('Reply ABOVE THIS LINE') |
| 12 | + expect(Griddler.configuration.email_service).to eq(:test_adapter) |
| 13 | + expect(Griddler.configuration.processor_method).to eq(:process) |
14 | 14 | end |
15 | 15 |
|
16 | 16 | it 'raises a helpful error if EmailProcessor is undefined' do |
17 | | - Kernel.stub(const_defined?: false) |
| 17 | + allow(Kernel).to receive_messages(const_defined?: false) |
18 | 18 |
|
19 | 19 | expect { Griddler.configuration.processor_class }.to raise_error(NameError, %r{https://github\.com/thoughtbot/griddler#defaults}) |
20 | 20 | end |
|
32 | 32 | config.processor_class = dummy_processor |
33 | 33 | end |
34 | 34 |
|
35 | | - Griddler.configuration.processor_class.should eq dummy_processor |
| 35 | + expect(Griddler.configuration.processor_class).to eq dummy_processor |
36 | 36 | end |
37 | 37 |
|
38 | 38 | it 'stores a processor_method' do |
39 | 39 | Griddler.configure do |config| |
40 | 40 | config.processor_method = :perform |
41 | 41 | end |
42 | 42 |
|
43 | | - Griddler.configuration.processor_method.should eq(:perform) |
| 43 | + expect(Griddler.configuration.processor_method).to eq(:perform) |
44 | 44 | end |
45 | 45 |
|
46 | 46 | it 'sets and stores an email_service' do |
47 | | - Griddler.should_receive(:adapter_registry).and_return(double(fetch: :configured_adapter)) |
| 47 | + expect(Griddler).to receive(:adapter_registry).and_return(double(fetch: :configured_adapter)) |
48 | 48 | Griddler.configure do |config| |
49 | 49 | config.email_service = :another_adapter |
50 | 50 | end |
51 | 51 |
|
52 | | - Griddler.configuration.email_service.should eq(:configured_adapter) |
| 52 | + expect(Griddler.configuration.email_service).to eq(:configured_adapter) |
53 | 53 | end |
54 | 54 |
|
55 | 55 | it 'accepts a :default symbol and uses sendgrid' do |
56 | 56 | Griddler.configure do |c| |
57 | 57 | c.email_service = :default |
58 | 58 | end |
59 | 59 |
|
60 | | - Griddler.configuration.email_service.should eq(:test_adapter) |
| 60 | + expect(Griddler.configuration.email_service).to eq(:test_adapter) |
61 | 61 | end |
62 | 62 |
|
63 | 63 | it 'raises an error when setting a non-existent email service adapter' do |
|
67 | 67 | end |
68 | 68 | end |
69 | 69 |
|
70 | | - config.should raise_error(Griddler::Errors::EmailServiceAdapterNotFound) |
| 70 | + expect(config).to raise_error(Griddler::Errors::EmailServiceAdapterNotFound) |
71 | 71 | end |
72 | 72 | end |
73 | 73 | end |
0 commit comments