diff --git a/README.md b/README.md index 70288b7..f94820c 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,13 @@ it 'should transition through' do expect { count.call }.to transition { counter.count }.through [0, 1, 4, 2, 0] end + +it 'should transition nowhere' do + counter = Counter.new + count = -> {} + + expect { count.call }.to transition { counter.count }.nowhere +end ``` ## Supported Rubies diff --git a/spec/transition_through_spec.rb b/spec/transition_through_spec.rb index 2e4efc3..61f76bf 100644 --- a/spec/transition_through_spec.rb +++ b/spec/transition_through_spec.rb @@ -105,6 +105,13 @@ def decrement(n = 1, by: 1) = n.times { self.count += by } expect { count.call }.to transition { counter.count }.through [0, 1, 4, 2, 0] end + + it 'should transition nowhere' do + counter = Counter.new + count = -> {} + + expect { count.call }.to transition { counter.count }.nowhere + end end end end