Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] add testcase for describe-level pending string only #583

Closed
wants to merge 1 commit into from

Conversation

Tieske
Copy link
Member

@Tieske Tieske commented Dec 6, 2018

When a pending entry is added on a describe level, then it will get lost if it doesn't have a function argument.

The added test shows the behaviour, but I haven't been able to add a fix, because of the way the code is structured (heavily event based).

Any help would be appreciated.

when a pending is added on describe level, without a function
argument, it is never shown.
@DorianGray
Copy link
Contributor

What needs to be done here?

@Tieske
Copy link
Member Author

Tieske commented Jul 31, 2019

a hint how to fix this?

@DorianGray
Copy link
Contributor

I'll try to refamiliarize myself with the code and get back with a fix then.

@blueyed
Copy link

blueyed commented Oct 17, 2019

It works like this:

diff --git i/spec/cl_pending.lua w/spec/cl_pending.lua
index 00fa725..8f6938e 100644
--- i/spec/cl_pending.lua
+++ w/spec/cl_pending.lua
@@ -12,5 +12,9 @@ describe('Tests the busted pending functions through the commandline>
       error('this should not run')
     end)
   end)
+
+  local it = pending(' (pending_reason)')
+  it('is made pending', function()
+    assert(false)
+  end)
 end)
-
diff --git i/spec/cl_spec.lua w/spec/cl_spec.lua
index ff3929c..33e4e46 100644
--- i/spec/cl_spec.lua
+++ w/spec/cl_spec.lua
@@ -564,8 +564,8 @@ describe('Tests pending through the commandline', function()
     local line1 = result:match('.-\n')
     local _, pendingDots = line1:gsub('%.', '')
     local _, numPending = result:gsub('Pending %-> .-\n', '')
-    assert.is_equal(2, pendingDots)
-    assert.is_equal(2, numPending)
+    assert.is_equal(3, pendingDots)
+    assert.is_equal(3, numPending)
   end)

   it('--suppress-pending option is honored', function()

The reason is that without a fn argument it returns the publish function itself: https://github.com/Olivine-Labs/busted/blob/8bbf64d4fa5fc8ba2cd67783da9f045b29c49764/busted/core.lua#L275

See also #610 (comment).

@Tieske
Copy link
Member Author

Tieske commented Aug 31, 2020

replaced by #636

@Tieske Tieske closed this Aug 31, 2020
@Tieske Tieske deleted the pending branch August 31, 2020 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants