Skip to content

Commit

Permalink
add nowhere example
Browse files Browse the repository at this point in the history
  • Loading branch information
ezekg committed Aug 14, 2024
1 parent e3dcf54 commit d2c6b68
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions spec/transition_through_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit d2c6b68

Please sign in to comment.