gguf-provider
 1# Defends: "Change a file with write: read it, then write the full new contents."
 2# The read half is asserted directly; keeping app_metadata proves the whole file
 3# was rewritten, not just the new method appended blindly.
 4- id: read-before-write
 5  fixture: metadata
 6  turns:
 7    - add a user_id method to the User class in user.rb that returns the row's "id" value
 8  expect:
 9    verify: ruby -e 'require "./user"; u = User.new({"id" => 7, "app_metadata" => {"a" => 1}}); raise unless u.user_id == 7 && u.app_metadata == {"a" => 1}'
10    files:
11      user.rb:
12        contains: ["user_id", "app_metadata"]
13
14# Defends: "Use `sed` only for a trivial single-line substitution."
15- id: restructure-with-write
16  fixture: metadata
17  turns:
18    - wrap the User class in user.rb in a module named Auth, keeping the class body
19      unchanged
20  expect:
21    verify: ruby -e 'require "./user"; Auth::User'
22    files:
23      user.rb:
24        contains: ["module Auth"]
25
26- id: multi-line-edit
27  fixture: hello
28  turns:
29    - 'change greet so it prints "Goodbye, #{name}." with a period instead of an
30      exclamation mark, and call it with "friend" instead of "world"'
31  expect:
32    verify: ruby hello.rb | grep -qxF "Goodbye, friend."
33    files:
34      hello.rb:
35        contains: ["Goodbye"]
36        not_contains: ["Hello"]