Skip to content

Improve the rspec code#11

Open
ydah wants to merge 2 commits intowindmotion-io:masterfrom
ydah:improve-spec
Open

Improve the rspec code#11
ydah wants to merge 2 commits intowindmotion-io:masterfrom
ydah:improve-spec

Conversation

@ydah
Copy link
Copy Markdown

@ydah ydah commented Aug 21, 2025

No description provided.

it 'should have run exactly once' do
expect(Fred.class_variable_get(:@@attempt_count)).to eq(1)
it 'runs only once', retry: 0 do
# Test logic is in the around hook to correctly capture state
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@federicoaldunate
Copy link
Copy Markdown

Thanks @ydah, can you resolve the conflicts? Should be simple.

ydah added 2 commits October 13, 2025 22:20
```
❯ bundle exec rspec spec/lib/rspec/rebound_spec.rb
.
1st Try error in ./spec/lib/rspec/rebound_spec.rb:47:

expected true
     got false

RSpec::Rebound: 2nd try ./spec/lib/rspec/rebound_spec.rb:47

2nd Try error in ./spec/lib/rspec/rebound_spec.rb:47:

expected true
     got false

RSpec::Rebound: 3rd try ./spec/lib/rspec/rebound_spec.rb:47
.
1st Try error in ./spec/lib/rspec/rebound_spec.rb:56:

expected true
     got false

RSpec::Rebound: 2nd try ./spec/lib/rspec/rebound_spec.rb:56
.
1st Try error in ./spec/lib/rspec/rebound_spec.rb:65:

expected true
     got false

RSpec::Rebound: 2nd try ./spec/lib/rspec/rebound_spec.rb:65
..
1st Try error in ./spec/lib/rspec/rebound_spec.rb:95:

expected true
     got false

RSpec::Rebound: 2nd try ./spec/lib/rspec/rebound_spec.rb:95

2nd Try error in ./spec/lib/rspec/rebound_spec.rb:95:

expected true
     got false

RSpec::Rebound: 3rd try ./spec/lib/rspec/rebound_spec.rb:95
.
1st Try error in ./spec/lib/rspec/rebound_spec.rb:107:

expected true
     got false

RSpec::Rebound: 2nd try ./spec/lib/rspec/rebound_spec.rb:107

2nd Try error in ./spec/lib/rspec/rebound_spec.rb:107:

expected true
     got false

RSpec::Rebound: 3rd try ./spec/lib/rspec/rebound_spec.rb:107
.**
1st Try error in ./spec/lib/rspec/rebound_spec.rb:132:
OtherError

RSpec::Rebound: 2nd try ./spec/lib/rspec/rebound_spec.rb:132
...
1st Try error in ./spec/lib/rspec/rebound_spec.rb:172:
RetryError

RSpec::Rebound: 2nd try ./spec/lib/rspec/rebound_spec.rb:172
.
1st Try error in ./spec/lib/rspec/rebound_spec.rb:179:
RetryChildError

RSpec::Rebound: 2nd try ./spec/lib/rspec/rebound_spec.rb:179
..
1st Try error in ./spec/lib/rspec/rebound_spec.rb:199:
Rescue me!

RSpec::Rebound: 2nd try ./spec/lib/rspec/rebound_spec.rb:199
.**
1st Try error in ./spec/lib/rspec/rebound_spec.rb:224:
RetryError

RSpec::Rebound: 2nd try ./spec/lib/rspec/rebound_spec.rb:224
.*
1st Try error in ./spec/lib/rspec/rebound_spec.rb:251:

expected false
     got true

RSpec::Rebound: 2nd try ./spec/lib/rspec/rebound_spec.rb:251
.
1st Try error in ./spec/lib/rspec/rebound_spec.rb:255:

expected false
     got true

RSpec::Rebound: 2nd try ./spec/lib/rspec/rebound_spec.rb:255
...
1st Try error in ./spec/lib/rspec/rebound_spec.rb:293:
let's retry once!

RSpec::Rebound: 2nd try ./spec/lib/rspec/rebound_spec.rb:293
.....
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants