minitest-promptfoo 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/minitest/promptfoo/rails.rb +4 -4
- data/lib/minitest/promptfoo/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 897a922e922eea260395f08b5f40433b548893a7db1a2b6e0c645596d142eb48
|
|
4
|
+
data.tar.gz: 8e272e24fd278722bde4a250f6d785413a2df9855a82362e266cca63cc7be3f5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 15348b1b8f62175e2b33e2982442bbad5b78cc8ecb79c9ebaf8dc17d85631a1cd05a46e9ead0da63b64e35cf1d03d7c762618f318bb992e84f1c8e86d8e0b6dc
|
|
7
|
+
data.tar.gz: 5c4e0dfd6f9f4343a8985964b0dee89fab2b65306ee768b56a713fc30970ecfd1ef45f95964f0df9c7a85bacc111db49b3d7757ea45d5997c2155095cc9b22fa
|
data/README.md
CHANGED
|
@@ -85,7 +85,7 @@ In Rails, the gem automatically discovers prompt files based on test file paths:
|
|
|
85
85
|
|
|
86
86
|
```ruby
|
|
87
87
|
# test/services/greeting_service_test.rb
|
|
88
|
-
class GreetingServiceTest < Minitest::Promptfoo::
|
|
88
|
+
class GreetingServiceTest < Minitest::Promptfoo::PromptTest
|
|
89
89
|
self.providers = "openai:gpt-4o-mini"
|
|
90
90
|
|
|
91
91
|
# Automatically finds app/services/greeting_service.ptmpl
|
|
@@ -303,7 +303,7 @@ When using `Minitest::Promptfoo::Test` (non-Rails), note these differences:
|
|
|
303
303
|
- No automatic database transaction rollbacks
|
|
304
304
|
- Uses plain Minitest assertions
|
|
305
305
|
|
|
306
|
-
For Rails projects, use `Minitest::Promptfoo::
|
|
306
|
+
For Rails projects, use `Minitest::Promptfoo::PromptTest` to get all Rails testing features plus automatic prompt discovery.
|
|
307
307
|
|
|
308
308
|
## Development
|
|
309
309
|
|
|
@@ -8,7 +8,7 @@ module Minitest
|
|
|
8
8
|
# app/services/foo/bar.ptmpl → test/services/foo/bar_test.rb
|
|
9
9
|
#
|
|
10
10
|
# Usage:
|
|
11
|
-
# class MyPromptTest < Minitest::Promptfoo::
|
|
11
|
+
# class MyPromptTest < Minitest::Promptfoo::PromptTest
|
|
12
12
|
# # No need to define prompt_path, it's auto-discovered!
|
|
13
13
|
#
|
|
14
14
|
# test "generates greeting" do
|
|
@@ -50,8 +50,8 @@ module Minitest
|
|
|
50
50
|
if defined?(ActiveSupport)
|
|
51
51
|
# Defer class definition until Rails test framework is fully loaded
|
|
52
52
|
ActiveSupport.on_load(:active_support_test_case) do
|
|
53
|
-
unless Minitest::Promptfoo.const_defined?(:
|
|
54
|
-
class
|
|
53
|
+
unless Minitest::Promptfoo.const_defined?(:PromptTest)
|
|
54
|
+
class PromptTest < ActiveSupport::TestCase
|
|
55
55
|
include Minitest::Promptfoo::TestMethods
|
|
56
56
|
include Minitest::Promptfoo::Rails
|
|
57
57
|
end
|
|
@@ -59,7 +59,7 @@ module Minitest
|
|
|
59
59
|
end
|
|
60
60
|
else
|
|
61
61
|
# Fallback if ActiveSupport isn't available
|
|
62
|
-
class
|
|
62
|
+
class PromptTest < Test
|
|
63
63
|
include Rails
|
|
64
64
|
end
|
|
65
65
|
end
|