stable 1.0.0 → 1.0.1

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 (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/stable/spec.rb +3 -0
  3. data/lib/stable.rb +2 -28
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b5d2929b75b7c0dbf556f482bd3b4eeb852cfebff63fd26e4debd66c1c6980e3
4
- data.tar.gz: fad79c07ad6849822bf0d73ff71ab104d4d4876efa6d6f146239ec7faa31a69b
3
+ metadata.gz: 12ffd6fd67c642b61f97a556ba19d1d605f1f0bab8feeeb0c4e74d7bf524f516
4
+ data.tar.gz: 4c956d0144152df1c2133880bff9ba2f64a672b3ffa7b81cf4af3b010e9ce0a8
5
5
  SHA512:
6
- metadata.gz: c2de06eb210c9f700779a3d07b131695749e7f6ad1e8d3d70d5d701bf7204b2a6834d3c0411d86be0c9bb7fbf81aab3a8d56603e259c8cca5cb1fd3ed9c72883
7
- data.tar.gz: 38511e64502515d0b24578c4d056a289ce3f65837a3e54b249b04b77714148a15e668f033b1746e1958206c51b4ee13995dde283d88642995916dc10802f0718
6
+ metadata.gz: 3df6eefa8dbc77140b38adaaddd0d4fa3c0ec7f74087413d8da2e5b005a6fe43531971ce047a2e72dcd3590a496732f0472f61283f003b873a3abb3844d4278a
7
+ data.tar.gz: 8b7335715e0e7f30c3824d05660afe93d6fc1ef3f09f94b6e4c18534bf0af1f50bec50c0742c6a553778a2f92e17f36cecb07bf93d5cb3be033b7ca0b9ba56c5
data/lib/stable/spec.rb CHANGED
@@ -2,6 +2,9 @@
2
2
  require 'json'
3
3
 
4
4
  module Stable
5
+ # a spec is a recording of a single method call, including the inputs and
6
+ # outputs. it's a self-contained, serializable representation of a method's
7
+ # behavior at a specific point in time.
5
8
  class Spec
6
9
  attr_reader :class_name, :method_name, :args, :result, :error, :timestamp
7
10
 
data/lib/stable.rb CHANGED
@@ -1,30 +1,5 @@
1
- # stable is a library for recording and replaying method calls. the idea of
2
- # this is to reduce the amount of manual unit tests you need to write, while
3
- # keeping the stability/notification system that unit tests provide.
4
- #
5
- # usage:
6
- #
7
- # require 'stable'
8
- #
9
- # # stable uses an IO-like object to write the captured inputs/outputs.
10
- # # if you don't set this, the default it to print the interaction records to
11
- # # $stdout, so you could also pipe the result to another place.
12
- # Stable.storage = File.open('captured_calls.jsonl', 'a')
13
- #
14
- # # wrap a method on a given class
15
- # Stable.capture(MyClass, :my_method)
16
- #
17
- # # enable runtime input/output capture
18
- # Stable.enable!
19
- #
20
- # MyClass.my_metehod # this will be captures by stable
21
- #
22
- # # disable input/output capture
23
- # Stable.disable!
24
- #
25
- # # replay captured calls, which gives you a unit test-list pass/fail
26
- # record = JSON.parse(File.read('captured_calls.jsonl').lines.first)
27
- # Stable.replay(record)
1
+ # `stable` is a library for recording and replaying method calls.
2
+ # See README.md for detailed usage instructions.
28
3
  require_relative 'stable/spec'
29
4
 
30
5
  module Stable
@@ -121,4 +96,3 @@ module Stable
121
96
  end
122
97
  end
123
98
  end
124
-
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stable
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Lunt