@@ -58,19 +58,37 @@ def _view
58
58
end
59
59
end
60
60
61
- context "the described is a module" do
62
- it "returns the module" do
63
- allow ( group ) . to receive ( :described_class ) { FoosHelper }
64
- expect ( group . determine_default_helper_class ( "ignore this" ) ) .
65
- to eq ( FoosHelper )
61
+ if ::Rails ::VERSION ::MAJOR > 3
62
+ context "the described is a module" do
63
+ it "returns the module" do
64
+ allow ( group ) . to receive ( :described_class ) { FoosHelper }
65
+ expect ( group . determine_default_helper_class ( "ignore this" ) ) .
66
+ to eq ( FoosHelper )
67
+ end
68
+ end
69
+
70
+ context "the described is a class" do
71
+ it "returns nil" do
72
+ allow ( group ) . to receive ( :described_class ) { FoosHelper ::InternalClass }
73
+ expect ( group . determine_default_helper_class ( "ignore this" ) ) .
74
+ to be_nil
75
+ end
76
+ end
77
+ else
78
+ context "the described is a module" do
79
+ it "returns the module" do
80
+ allow ( group ) . to receive ( :described_class ) { FoosHelper }
81
+ expect ( group . determine_default_helper_class ( "ignore this" ) ) .
82
+ to eq ( FoosHelper )
83
+ end
66
84
end
67
- end
68
85
69
- context "the described is a class" do
70
- it "returns nil" do
71
- allow ( group ) . to receive ( :described_class ) { FoosHelper ::InternalClass }
72
- expect ( group . determine_default_helper_class ( "ignore this" ) ) .
73
- to be_nil
86
+ context "the described is a class" do
87
+ it "returns the class" do
88
+ allow ( group ) . to receive ( :described_class ) { FoosHelper ::InternalClass }
89
+ expect ( group . determine_default_helper_class ( "ignore this" ) ) .
90
+ to eq ( FoosHelper ::InternalClass )
91
+ end
74
92
end
75
93
end
76
94
end
0 commit comments