backspin 0.9.0 → 0.11.0

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.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +14 -0
  3. data/Gemfile.lock +1 -1
  4. data/MATCHERS.md +18 -0
  5. data/README.md +57 -0
  6. data/docs/backspin-result-api-sketch.md +13 -9
  7. data/fixtures/backspin/.gitkeep +1 -0
  8. data/lib/backspin/command_diff.rb +70 -13
  9. data/lib/backspin/matcher.rb +59 -51
  10. data/lib/backspin/record.rb +60 -6
  11. data/lib/backspin/recorder.rb +6 -3
  12. data/lib/backspin/snapshot.rb +52 -19
  13. data/lib/backspin/version.rb +1 -1
  14. data/lib/backspin.rb +38 -21
  15. metadata +2 -56
  16. data/fixtures/backspin/all_and_fields.yml +0 -15
  17. data/fixtures/backspin/all_bypass_equality.yml +0 -14
  18. data/fixtures/backspin/all_checks_equality.yml +0 -17
  19. data/fixtures/backspin/all_for_logging.yml +0 -14
  20. data/fixtures/backspin/all_matcher_basic.yml +0 -14
  21. data/fixtures/backspin/all_matcher_custom.yml +0 -17
  22. data/fixtures/backspin/all_matcher_demo.yml +0 -14
  23. data/fixtures/backspin/all_matcher_test.yml +0 -14
  24. data/fixtures/backspin/all_mode_filter.yml +0 -14
  25. data/fixtures/backspin/all_no_short_circuit.yml +0 -14
  26. data/fixtures/backspin/all_pass_field_fail.yml +0 -14
  27. data/fixtures/backspin/all_short_circuit.yml +0 -14
  28. data/fixtures/backspin/all_skips_equality.yml +0 -17
  29. data/fixtures/backspin/all_with_equality.yml +0 -17
  30. data/fixtures/backspin/all_with_fields.yml +0 -17
  31. data/fixtures/backspin/combined_fail_demo.yml +0 -14
  32. data/fixtures/backspin/combined_matcher_demo.yml +0 -14
  33. data/fixtures/backspin/credential_filter.yml +0 -18
  34. data/fixtures/backspin/echo_hello.yml +0 -14
  35. data/fixtures/backspin/echo_verify.yml +0 -14
  36. data/fixtures/backspin/episodes_filter.yml +0 -26
  37. data/fixtures/backspin/failure_test.yml +0 -14
  38. data/fixtures/backspin/field_matcher_demo.yml +0 -17
  39. data/fixtures/backspin/field_matcher_values.yml +0 -14
  40. data/fixtures/backspin/full_data_filter.yml +0 -17
  41. data/fixtures/backspin/key_confusion_test.yml +0 -14
  42. data/fixtures/backspin/match_on_any_fail.yml +0 -21
  43. data/fixtures/backspin/match_on_bad_format.yml +0 -14
  44. data/fixtures/backspin/match_on_fail.yml +0 -15
  45. data/fixtures/backspin/match_on_invalid.yml +0 -14
  46. data/fixtures/backspin/match_on_multiple.yml +0 -28
  47. data/fixtures/backspin/match_on_nil.yml +0 -14
  48. data/fixtures/backspin/match_on_other_fields.yml +0 -23
  49. data/fixtures/backspin/match_on_run_bang.yml +0 -16
  50. data/fixtures/backspin/match_on_run_bang_fail.yml +0 -15
  51. data/fixtures/backspin/match_on_single.yml +0 -17
  52. data/fixtures/backspin/mixed_calls.yml +0 -24
  53. data/fixtures/backspin/multi_command.yml +0 -34
  54. data/fixtures/backspin/multi_command_filter.yml +0 -26
  55. data/fixtures/backspin/multi_field_filter.yml +0 -13
  56. data/fixtures/backspin/multi_system.yml +0 -20
  57. data/fixtures/backspin/nil_filter.yml +0 -14
  58. data/fixtures/backspin/none_mode_test.yml +0 -14
  59. data/fixtures/backspin/path_test.yml +0 -17
  60. data/fixtures/backspin/playback_system.yml +0 -12
  61. data/fixtures/backspin/playback_test.yml +0 -14
  62. data/fixtures/backspin/stderr_test.yml +0 -19
  63. data/fixtures/backspin/strict_test.yml +0 -14
  64. data/fixtures/backspin/string_symbol_test.yml +0 -14
  65. data/fixtures/backspin/system_echo.yml +0 -12
  66. data/fixtures/backspin/system_false.yml +0 -18
  67. data/fixtures/backspin/timestamp_test.yml +0 -18
  68. data/fixtures/backspin/verify_system.yml +0 -12
  69. data/fixtures/backspin/verify_system_diff.yml +0 -11
  70. data/fixtures/backspin/version_test.yml +0 -14
@@ -1,17 +0,0 @@
1
- ---
2
- first_recorded_at: '2025-06-10T11:02:02-05:00'
3
- format_version: '2.0'
4
- commands:
5
- - command_type: Open3::Capture3
6
- args:
7
- - sh
8
- - "-c"
9
- - echo 'output'; echo 'error' >&2; exit 42
10
- stdout: 'output
11
-
12
- '
13
- stderr: 'error
14
-
15
- '
16
- status: 42
17
- recorded_at: '2025-06-10T11:02:02-05:00'
@@ -1,14 +0,0 @@
1
- ---
2
- first_recorded_at: '2025-06-10T11:00:57-05:00'
3
- format_version: '2.0'
4
- commands:
5
- - command_type: Open3::Capture3
6
- args:
7
- - echo
8
- - hello
9
- stdout: 'hello
10
-
11
- '
12
- stderr: ''
13
- status: 0
14
- recorded_at: '2025-06-10T11:00:57-05:00'
@@ -1,17 +0,0 @@
1
- ---
2
- first_recorded_at: '2025-05-01T12:00:00Z'
3
- format_version: '2.0'
4
- commands:
5
- - command_type: Open3::Capture3
6
- args:
7
- - bash
8
- - "-c"
9
- - echo 'stdout message' && echo 'stderr message' >&2 && exit 42
10
- stdout: 'stdout message
11
-
12
- '
13
- stderr: 'stderr message
14
-
15
- '
16
- status: 42
17
- recorded_at: '2025-05-01T12:00:00Z'
@@ -1,14 +0,0 @@
1
- ---
2
- first_recorded_at: '2025-06-10T11:00:27-05:00'
3
- format_version: '2.0'
4
- commands:
5
- - command_type: Open3::Capture3
6
- args:
7
- - echo
8
- - first output
9
- stdout: 'first output
10
-
11
- '
12
- stderr: ''
13
- status: 0
14
- recorded_at: '2025-06-10T11:00:27-05:00'
@@ -1,21 +0,0 @@
1
- ---
2
- first_recorded_at: '2025-05-01T12:00:00Z'
3
- format_version: '2.0'
4
- commands:
5
- - command_type: Open3::Capture3
6
- args:
7
- - sh
8
- - "-c"
9
- - "'echo"
10
- - good;
11
- - echo
12
- - bad
13
- - ">&2'"
14
- stdout: 'good
15
-
16
- '
17
- stderr: 'bad
18
-
19
- '
20
- status: 0
21
- recorded_at: '2025-05-01T12:00:00Z'
@@ -1,14 +0,0 @@
1
- ---
2
- first_recorded_at: '2025-05-01T12:00:00Z'
3
- format_version: '2.0'
4
- commands:
5
- - command_type: Open3::Capture3
6
- args:
7
- - echo
8
- - test
9
- stdout: 'test
10
-
11
- '
12
- stderr: ''
13
- status: 0
14
- recorded_at: '2025-05-01T12:00:00Z'
@@ -1,15 +0,0 @@
1
- ---
2
- first_recorded_at: '2025-05-01T12:00:00Z'
3
- format_version: '2.0'
4
- commands:
5
- - command_type: Open3::Capture3
6
- args:
7
- - echo
8
- - "'Version:"
9
- - 1.2.3'
10
- stdout: 'Version: 1.2.3
11
-
12
- '
13
- stderr: ''
14
- status: 0
15
- recorded_at: '2025-05-01T12:00:00Z'
@@ -1,14 +0,0 @@
1
- ---
2
- first_recorded_at: '2025-05-01T12:00:00Z'
3
- format_version: '2.0'
4
- commands:
5
- - command_type: Open3::Capture3
6
- args:
7
- - echo
8
- - test
9
- stdout: 'test
10
-
11
- '
12
- stderr: ''
13
- status: 0
14
- recorded_at: '2025-05-01T12:00:00Z'
@@ -1,28 +0,0 @@
1
- ---
2
- first_recorded_at: '2025-05-01T12:00:00Z'
3
- format_version: '2.0'
4
- commands:
5
- - command_type: Open3::Capture3
6
- args:
7
- - sh
8
- - "-c"
9
- - "'echo"
10
- - "\"User:"
11
- - alice@example.com";
12
- - echo
13
- - "\"Error:"
14
- - Connection
15
- - timeout
16
- - at
17
- - 10:30:00"
18
- - ">&2;"
19
- - exit
20
- - 1'
21
- stdout: 'User: alice@example.com
22
-
23
- '
24
- stderr: 'Error: Connection timeout at 10:30:00
25
-
26
- '
27
- status: 1
28
- recorded_at: '2025-05-01T12:00:00Z'
@@ -1,14 +0,0 @@
1
- ---
2
- first_recorded_at: '2025-05-01T12:00:00Z'
3
- format_version: '2.0'
4
- commands:
5
- - command_type: Open3::Capture3
6
- args:
7
- - echo
8
- - test
9
- stdout: 'test
10
-
11
- '
12
- stderr: ''
13
- status: 0
14
- recorded_at: '2025-05-01T12:00:00Z'
@@ -1,23 +0,0 @@
1
- ---
2
- first_recorded_at: '2025-05-01T12:00:00Z'
3
- format_version: '2.0'
4
- commands:
5
- - command_type: Open3::Capture3
6
- args:
7
- - sh
8
- - "-c"
9
- - "'echo"
10
- - output;
11
- - echo
12
- - error
13
- - ">&2;"
14
- - exit
15
- - 1'
16
- stdout: 'output
17
-
18
- '
19
- stderr: 'error
20
-
21
- '
22
- status: 1
23
- recorded_at: '2025-05-01T12:00:00Z'
@@ -1,16 +0,0 @@
1
- ---
2
- first_recorded_at: '2025-05-01T12:00:00Z'
3
- format_version: '2.0'
4
- commands:
5
- - command_type: Open3::Capture3
6
- args:
7
- - echo
8
- - "'Process"
9
- - 'ID:'
10
- - 12345'
11
- stdout: 'Process ID: 12345
12
-
13
- '
14
- stderr: ''
15
- status: 0
16
- recorded_at: '2025-05-01T12:00:00Z'
@@ -1,15 +0,0 @@
1
- ---
2
- first_recorded_at: '2025-05-01T12:00:00Z'
3
- format_version: '2.0'
4
- commands:
5
- - command_type: Open3::Capture3
6
- args:
7
- - echo
8
- - "'Status:"
9
- - OK'
10
- stdout: 'Status: OK
11
-
12
- '
13
- stderr: ''
14
- status: 0
15
- recorded_at: '2025-05-01T12:00:00Z'
@@ -1,17 +0,0 @@
1
- ---
2
- first_recorded_at: '2025-05-01T12:00:00Z'
3
- format_version: '2.0'
4
- commands:
5
- - command_type: Open3::Capture3
6
- args:
7
- - echo
8
- - "'Current"
9
- - 'time:'
10
- - '2025-01-06'
11
- - 10:00:00'
12
- stdout: 'Current time: 2025-01-06 10:00:00
13
-
14
- '
15
- stderr: ''
16
- status: 0
17
- recorded_at: '2025-05-01T12:00:00Z'
@@ -1,24 +0,0 @@
1
- ---
2
- first_recorded_at: '2025-05-01T12:00:00Z'
3
- format_version: '2.0'
4
- commands:
5
- - command_type: Kernel::System
6
- args:
7
- - echo
8
- - from
9
- - system
10
- stdout: ''
11
- stderr: ''
12
- status: 0
13
- recorded_at: '2025-05-01T12:00:00Z'
14
- - command_type: Open3::Capture3
15
- args:
16
- - echo
17
- - from
18
- - capture3
19
- stdout: 'from capture3
20
-
21
- '
22
- stderr: ''
23
- status: 0
24
- recorded_at: '2025-05-01T12:00:00Z'
@@ -1,34 +0,0 @@
1
- ---
2
- first_recorded_at: '2025-05-01T12:00:00Z'
3
- format_version: '2.0'
4
- commands:
5
- - command_type: Open3::Capture3
6
- args:
7
- - echo
8
- - first
9
- stdout: 'first
10
-
11
- '
12
- stderr: ''
13
- status: 0
14
- recorded_at: '2025-05-01T12:00:00Z'
15
- - command_type: Open3::Capture3
16
- args:
17
- - echo
18
- - second
19
- stdout: 'second
20
-
21
- '
22
- stderr: ''
23
- status: 0
24
- recorded_at: '2025-05-01T12:00:00Z'
25
- - command_type: Open3::Capture3
26
- args:
27
- - echo
28
- - third
29
- stdout: 'third
30
-
31
- '
32
- stderr: ''
33
- status: 0
34
- recorded_at: '2025-05-01T12:00:00Z'
@@ -1,26 +0,0 @@
1
- ---
2
- first_recorded_at: '2025-05-01T12:00:00Z'
3
- format_version: '2.0'
4
- commands:
5
- - command_type: Open3::Capture3
6
- args:
7
- - echo
8
- - "'Count:"
9
- - 42'
10
- stdout: 'Count: X
11
-
12
- '
13
- stderr: ''
14
- status: 0
15
- recorded_at: '2025-05-01T12:00:00Z'
16
- - command_type: Open3::Capture3
17
- args:
18
- - echo
19
- - "'Total:"
20
- - 100'
21
- stdout: 'Total: X
22
-
23
- '
24
- stderr: ''
25
- status: 0
26
- recorded_at: '2025-05-01T12:00:00Z'
@@ -1,13 +0,0 @@
1
- ---
2
- first_recorded_at: '2025-05-01T12:00:00Z'
3
- format_version: '2.0'
4
- commands:
5
- - command_type: Open3::Capture3
6
- args:
7
- - bash
8
- - "-c"
9
- - echo 'out' && echo 'err' >&2 && exit 1
10
- stdout: modified stdout
11
- stderr: modified stderr
12
- status: 0
13
- recorded_at: '2025-05-01T12:00:00Z'
@@ -1,20 +0,0 @@
1
- ---
2
- first_recorded_at: '2025-05-01T12:00:00Z'
3
- format_version: '2.0'
4
- commands:
5
- - command_type: Kernel::System
6
- args:
7
- - echo
8
- - first
9
- stdout: ''
10
- stderr: ''
11
- status: 0
12
- recorded_at: '2025-05-01T12:00:00Z'
13
- - command_type: Kernel::System
14
- args:
15
- - echo
16
- - second
17
- stdout: ''
18
- stderr: ''
19
- status: 0
20
- recorded_at: '2025-05-01T12:00:00Z'
@@ -1,14 +0,0 @@
1
- ---
2
- first_recorded_at: '2025-05-01T12:00:00Z'
3
- format_version: '2.0'
4
- commands:
5
- - command_type: Open3::Capture3
6
- args:
7
- - echo
8
- - "'test'"
9
- stdout: 'test
10
-
11
- '
12
- stderr: ''
13
- status: 0
14
- recorded_at: '2025-05-01T12:00:00Z'
@@ -1,14 +0,0 @@
1
- ---
2
- first_recorded_at: '2025-05-01T12:00:00Z'
3
- format_version: '2.0'
4
- commands:
5
- - command_type: Open3::Capture3
6
- args:
7
- - echo
8
- - "'original'"
9
- stdout: 'original
10
-
11
- '
12
- stderr: ''
13
- status: 0
14
- recorded_at: '2025-05-01T12:00:00Z'
@@ -1,17 +0,0 @@
1
- ---
2
- first_recorded_at: '2025-05-01T12:00:00Z'
3
- format_version: '2.0'
4
- commands:
5
- - command_type: Open3::Capture3
6
- args:
7
- - echo
8
- - "'File"
9
- - saved
10
- - to
11
- - "/Users/testuser/project/output.txt'"
12
- stdout: 'File saved to PROJECT_ROOT/output.txt
13
-
14
- '
15
- stderr: ''
16
- status: 0
17
- recorded_at: '2025-05-01T12:00:00Z'
@@ -1,12 +0,0 @@
1
- ---
2
- first_recorded_at: '2025-05-01T12:00:00Z'
3
- format_version: '2.0'
4
- commands:
5
- - command_type: Kernel::System
6
- args:
7
- - echo
8
- - recorded
9
- stdout: ''
10
- stderr: ''
11
- status: 0
12
- recorded_at: '2025-05-01T12:00:00Z'
@@ -1,14 +0,0 @@
1
- ---
2
- first_recorded_at: '2025-05-01T12:00:00Z'
3
- format_version: '2.0'
4
- commands:
5
- - command_type: Open3::Capture3
6
- args:
7
- - echo
8
- - original
9
- stdout: 'original
10
-
11
- '
12
- stderr: ''
13
- status: 0
14
- recorded_at: '2025-05-01T12:00:00Z'
@@ -1,19 +0,0 @@
1
- ---
2
- first_recorded_at: '2025-05-01T12:00:00Z'
3
- format_version: '2.0'
4
- commands:
5
- - command_type: Open3::Capture3
6
- args:
7
- - sh
8
- - "-c"
9
- - "'echo"
10
- - error
11
- - ">&2;"
12
- - exit
13
- - 1'
14
- stdout: ''
15
- stderr: 'error
16
-
17
- '
18
- status: 1
19
- recorded_at: '2025-05-01T12:00:00Z'
@@ -1,14 +0,0 @@
1
- ---
2
- first_recorded_at: '2025-05-01T12:00:00Z'
3
- format_version: '2.0'
4
- commands:
5
- - command_type: Open3::Capture3
6
- args:
7
- - echo
8
- - exact output
9
- stdout: 'exact output
10
-
11
- '
12
- stderr: ''
13
- status: 0
14
- recorded_at: '2025-05-01T12:00:00Z'
@@ -1,14 +0,0 @@
1
- ---
2
- first_recorded_at: '2025-06-10T11:00:57-05:00'
3
- format_version: '2.0'
4
- commands:
5
- - command_type: Open3::Capture3
6
- args:
7
- - echo
8
- - test output
9
- stdout: 'test output
10
-
11
- '
12
- stderr: ''
13
- status: 0
14
- recorded_at: '2025-06-10T11:00:57-05:00'
@@ -1,12 +0,0 @@
1
- ---
2
- first_recorded_at: '2025-05-01T12:00:00Z'
3
- format_version: '2.0'
4
- commands:
5
- - command_type: Kernel::System
6
- args:
7
- - echo
8
- - hello
9
- stdout: ''
10
- stderr: ''
11
- status: 0
12
- recorded_at: '2025-05-01T12:00:00Z'
@@ -1,18 +0,0 @@
1
- ---
2
- first_recorded_at: '2025-05-01T12:00:00Z'
3
- format_version: '2.0'
4
- commands:
5
- - command_type: Kernel::System
6
- args:
7
- - 'true'
8
- stdout: ''
9
- stderr: ''
10
- status: 0
11
- recorded_at: '2025-05-01T12:00:00Z'
12
- - command_type: Kernel::System
13
- args:
14
- - 'false'
15
- stdout: ''
16
- stderr: ''
17
- status: 1
18
- recorded_at: '2025-05-01T12:00:00Z'
@@ -1,18 +0,0 @@
1
- ---
2
- first_recorded_at: '2025-05-01T12:00:00Z'
3
- format_version: '2.0'
4
- commands:
5
- - command_type: Open3::Capture3
6
- args:
7
- - echo
8
- - "'Test"
9
- - run
10
- - at
11
- - '2024-01-15'
12
- - 10:30:45'
13
- stdout: 'Test run at TIMESTAMP
14
-
15
- '
16
- stderr: ''
17
- status: 0
18
- recorded_at: '2025-05-01T12:00:00Z'
@@ -1,12 +0,0 @@
1
- ---
2
- first_recorded_at: '2025-05-01T12:00:00Z'
3
- format_version: '2.0'
4
- commands:
5
- - command_type: Kernel::System
6
- args:
7
- - echo
8
- - hello
9
- stdout: ''
10
- stderr: ''
11
- status: 0
12
- recorded_at: '2025-05-01T12:00:00Z'
@@ -1,11 +0,0 @@
1
- ---
2
- first_recorded_at: '2025-05-01T12:00:00Z'
3
- format_version: '2.0'
4
- commands:
5
- - command_type: Kernel::System
6
- args:
7
- - 'true'
8
- stdout: ''
9
- stderr: ''
10
- status: 0
11
- recorded_at: '2025-05-01T12:00:00Z'
@@ -1,14 +0,0 @@
1
- ---
2
- first_recorded_at: '2025-05-01T12:00:00Z'
3
- format_version: '2.0'
4
- commands:
5
- - command_type: Open3::Capture3
6
- args:
7
- - echo
8
- - ruby version 3.4.5
9
- stdout: 'ruby version 3.4.5
10
-
11
- '
12
- stderr: ''
13
- status: 0
14
- recorded_at: '2025-05-01T12:00:00Z'