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

Make the current scope available for stubbing everywhere #310

Open
DavidS opened this issue Jul 1, 2015 · 8 comments
Open

Make the current scope available for stubbing everywhere #310

DavidS opened this issue Jul 1, 2015 · 8 comments
Labels

Comments

@DavidS
Copy link
Collaborator

DavidS commented Jul 1, 2015

From the discussion in #108: it is necessary to have access to the compiling scope in all example groups, as in d3f737e

@DavidS DavidS added the feature label Jul 1, 2015
@jhoblitt
Copy link
Contributor

jhoblitt commented Jul 1, 2015

Indeed. I'd like to be able to express a spec along the lines of:

        it 'should be deprecated' do
          scope.expects(:warning).with('... is deprecated.')
          ...
        end

@electrical
Copy link

+1
Want to test for certain situations where it leads to warnings instead of failures.

@electrical
Copy link

@DavidS any progress on this by any chance? :-)

@DavidS
Copy link
Collaborator Author

DavidS commented May 11, 2016

This is - sadly - still a side^3 project for me.

@smu-ggl
Copy link

smu-ggl commented Jan 17, 2017

Any chance of this getting addressed anytime soon?
I ran into multiple cases where this would have been useful.

@DavidS
Copy link
Collaborator Author

DavidS commented Jan 17, 2017

@smu-ggl my comment from last year still applies. Sadly. The most I can currently invest is reviewing code.

@rodjek rodjek added this to the 2.6.0 milestone Apr 5, 2017
@rodjek rodjek removed this from the 2.6.0 milestone Jul 1, 2017
@reidmv
Copy link

reidmv commented Mar 26, 2018

@rodjek looks like this was briefly added to a milestone, but then removed. Any update on this?

@trevor-vaughan
Copy link
Contributor

trevor-vaughan commented Sep 17, 2020

Resurrecting the thread!

Here's how I'm doing it currently:

let(:pre_condition) do
  # Mask `warning` for testing
  <<~PRE_CONDITION
  function warning($message) { notify { 'warning_test': message => $message } }
  PRE_CONDITION
end

it { is_expected.to create_notify('warning_test').with_message(/<whatever>/) }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants