|
23 | 23 |
|
24 | 24 | let(:verdicts) do |
25 | 25 | [ |
26 | | - { "verdict" => "Yes" }, |
27 | | - { "verdict" => "No", "reason" => "The statement is irrelevant." }, |
| 26 | + { "verdict" => "yes" }, |
| 27 | + { "verdict" => "no", "reason" => "The statement is irrelevant." }, |
28 | 28 | ] |
29 | 29 | end |
30 | 30 | let(:verdicts_json) { { verdicts: }.to_json } |
|
90 | 90 | reason: shared_expected_metrics_attributes, |
91 | 91 | } |
92 | 92 | expect(result) |
93 | | - .to be_a(described_class::Result) |
| 93 | + .to be_a(AutoEvaluation::ScoreResult) |
94 | 94 | .and have_attributes( |
95 | 95 | score: 0.5, |
96 | 96 | reason:, |
|
104 | 104 | let(:verdicts) do |
105 | 105 | [ |
106 | 106 | { "verdict" => "idk", "reason" => "Cannot determine relevance." }, |
107 | | - { "verdict" => "No", "reason" => "The statement is irrelevant." }, |
| 107 | + { "verdict" => "no", "reason" => "The statement is irrelevant." }, |
108 | 108 | ] |
109 | 109 | end |
110 | 110 |
|
|
130 | 130 | ) |
131 | 131 |
|
132 | 132 | expect(result) |
133 | | - .to be_a(described_class::Result) |
| 133 | + .to be_a(AutoEvaluation::ScoreResult) |
134 | 134 | .and have_attributes( |
135 | 135 | score: 1.0, |
136 | 136 | reason: "No statements were extracted from the answer.", |
|
154 | 154 | ) |
155 | 155 |
|
156 | 156 | expect(result) |
157 | | - .to be_a(described_class::Result) |
| 157 | + .to be_a(AutoEvaluation::ScoreResult) |
158 | 158 | .and have_attributes( |
159 | 159 | score: 1.0, |
160 | 160 | reason: "No verdicts were generated for the extracted statements.", |
|
172 | 172 | end |
173 | 173 |
|
174 | 174 | context "when verdicts are generated and none have a 'no' verdict" do |
175 | | - let(:verdicts_json) { { verdicts: [{ "verdict" => "Yes" }, { "verdict" => "Yes" }] }.to_json } |
| 175 | + let(:verdicts_json) { { verdicts: [{ "verdict" => "yes" }, { "verdict" => "yes" }] }.to_json } |
176 | 176 |
|
177 | 177 | it "returns a result object with the expected attributes" do |
178 | 178 | allow(Clock).to receive(:monotonic_time).and_return(200.0, 202.0, 204.0, 206.0) |
|
183 | 183 | ) |
184 | 184 |
|
185 | 185 | expect(result) |
186 | | - .to be_a(described_class::Result) |
| 186 | + .to be_a(AutoEvaluation::ScoreResult) |
187 | 187 | .and have_attributes( |
188 | 188 | score: 1.0, |
189 | 189 | reason: "The response fully addressed the input with no irrelevant statements.", |
|
0 commit comments