Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Whitespace
Browse files Browse the repository at this point in the history
elia committed Jul 27, 2015
1 parent c4f32eb commit edca1d0
Showing 1 changed file with 35 additions and 35 deletions.
70 changes: 35 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
@@ -64,46 +64,46 @@ describe MyClass do
# async example
it 'does something else, too' do
promise = Promise.new
delay 1 do
expect(:foo).to eq(:foo)
promise.resolve
end
promise
delay 1 do
expect(:foo).to eq(:foo)
promise.resolve
end
promise
end

it 'does another thing' do
# Argument is number of seconds, delay_with_promise is a convenience method that will
# call setTimeout with the block and return a promise
delay_with_promise 0 do
expect(:foo).to eq(:foo)
end
end

it 'does another thing' do
# Argument is number of seconds, delay_with_promise is a convenience method that will
# call setTimeout with the block and return a promise
delay_with_promise 0 do
expect(:foo).to eq(:foo)
end
end
end

describe MyClass2 do
# will wait for the before promise to complete before proceeding
before do
delay_with_promise 0 do
puts 'async before 'action
end
end
# async subject works too
subject do
delay_with_promise 0 do
42
end
end
it { is_expected.to eq 42 }
# If you use an around block and have async specs, you must use this approach
around do |example|
puts 'do stuff before'
example.run.then do
puts 'do stuff after example'
end
end
before do
delay_with_promise 0 do
puts 'async before 'action
end
end

# async subject works too
subject do
delay_with_promise 0 do
42
end
end

it { is_expected.to eq 42 }

# If you use an around block and have async specs, you must use this approach
around do |example|
puts 'do stuff before'
example.run.then do
puts 'do stuff after example'
end
end
end
```

0 comments on commit edca1d0

Please sign in to comment.