|
3 | 3 | require 'spec_helper' |
4 | 4 |
|
5 | 5 | RSpec.describe HatiCommand::Befehl do |
6 | | - before do |
7 | | - stub_const('BefehlClass', Class.new do |
8 | | - extend HatiCommand::Befehl::BefehlClassMethods |
9 | | - |
10 | | - command do |
11 | | - fail_fast 'Befehl Fail Fast Message' |
12 | | - failure 'Befehl Failure Message' |
13 | | - unexpected_err 'Befehl Unexpected Error' |
14 | | - result_inference true |
15 | | - end |
16 | | - end) |
17 | | - end |
| 6 | + describe 'command configurations' do |
| 7 | + before do |
| 8 | + stub_const('BefehlClass', Class.new do |
| 9 | + extend HatiCommand::Befehl::BefehlClassMethods |
| 10 | + |
| 11 | + command do |
| 12 | + call_as :execute |
| 13 | + fail_fast 'Befehl Fail Fast Message' |
| 14 | + failure 'Befehl Failure Message' |
| 15 | + unexpected_err 'Befehl Unexpected Error' |
| 16 | + result_inference true |
| 17 | + end |
| 18 | + end) |
| 19 | + end |
18 | 20 |
|
19 | | - let(:befehl_klass) { BefehlClass } |
20 | | - let(:configs) { befehl_klass.command_config } |
| 21 | + let(:befehl_klass) { BefehlClass } |
| 22 | + let(:configs) { befehl_klass.command_config } |
21 | 23 |
|
22 | | - describe '.fail_fast' do |
23 | | - it 'sets the fail_fast config' do |
24 | | - expect(befehl_klass.command_config[:fail_fast]).to eq('Befehl Fail Fast Message') |
| 24 | + describe '.fail_fast' do |
| 25 | + it 'sets the fail_fast config' do |
| 26 | + expect(befehl_klass.command_config[:fail_fast]).to eq('Befehl Fail Fast Message') |
| 27 | + end |
25 | 28 | end |
26 | | - end |
27 | 29 |
|
28 | | - describe '.unexpected_err' do |
29 | | - it 'sets the unexpected_err config' do |
30 | | - expect(befehl_klass.command_config[:unexpected_err]).to eq('Befehl Unexpected Error') |
| 30 | + describe '.unexpected_err' do |
| 31 | + it 'sets the unexpected_err config' do |
| 32 | + expect(befehl_klass.command_config[:unexpected_err]).to eq('Befehl Unexpected Error') |
| 33 | + end |
31 | 34 | end |
32 | | - end |
33 | 35 |
|
34 | | - describe '.failure' do |
35 | | - it 'sets the failure config' do |
36 | | - expect(befehl_klass.command_config[:failure]).to eq('Befehl Failure Message') |
| 36 | + describe '.failure' do |
| 37 | + it 'sets the failure config' do |
| 38 | + expect(befehl_klass.command_config[:failure]).to eq('Befehl Failure Message') |
| 39 | + end |
37 | 40 | end |
38 | | - end |
39 | 41 |
|
40 | | - describe '.result_inference' do |
41 | | - it 'sets the result_inference config' do |
42 | | - expect(befehl_klass.command_config[:result_inference]).to be(true) |
| 42 | + describe '.result_inference' do |
| 43 | + it 'sets the result_inference config' do |
| 44 | + expect(befehl_klass.command_config[:result_inference]).to be(true) |
| 45 | + end |
43 | 46 | end |
44 | | - end |
45 | 47 |
|
46 | | - describe '.command_config' do |
47 | | - it 'returns the configurations' do |
48 | | - aggregate_failures 'of command options' do |
49 | | - expect(configs[:fail_fast]).to eq('Befehl Fail Fast Message') |
50 | | - expect(configs[:failure]).to eq('Befehl Failure Message') |
51 | | - expect(configs[:unexpected_err]).to eq('Befehl Unexpected Error') |
52 | | - expect(configs[:result_inference]).to be(true) |
| 48 | + describe '.command_config' do |
| 49 | + it 'returns the configurations' do |
| 50 | + aggregate_failures 'of command options' do |
| 51 | + expect(configs[:fail_fast]).to eq('Befehl Fail Fast Message') |
| 52 | + expect(configs[:failure]).to eq('Befehl Failure Message') |
| 53 | + expect(configs[:unexpected_err]).to eq('Befehl Unexpected Error') |
| 54 | + expect(configs[:result_inference]).to be(true) |
| 55 | + expect(configs[:call_as]).to be(:execute) |
| 56 | + end |
53 | 57 | end |
54 | 58 | end |
55 | 59 | end |
|
0 commit comments