Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

documentation for RSpec::Core::World #1337

Merged
merged 2 commits into from
Feb 23, 2014
Merged

documentation for RSpec::Core::World #1337

merged 2 commits into from
Feb 23, 2014

Conversation

alexander-clark
Copy link
Contributor

Taking a stab at documenting the World class. Any feedback would be appreciated.

@@ -20,52 +21,85 @@ def initialize(configuration=RSpec.configuration)
}
end

# @api private
Copy link
Member

Choose a reason for hiding this comment

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

@myronmarston some of these things seem public to me, WDYT

Copy link
Member

Choose a reason for hiding this comment

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

Most of these methods are meant for internal use and don't really have an intended use by end users or extension gem developers. The one exception I can think of is reset -- I think I saw discussion of it being used for an alternate parallel runner at some point.

That said, RSpec.world is itself labeled as private (see 1354f1a, where it was labeled that way).

I think the class as a whole should be labeled @api private. Anything that's actually needed as a public API should be exposed off of RSpec., and all the private APIs off of RSpec. should be removed so that RSpec. is the global entry point for the public APIs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So should I take @api private off of reset for the time being or leave it there in anticipation of #1338?

Copy link
Member

Choose a reason for hiding this comment

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

Leave it on there. Then there'll be less to do later.

I did a code search for world.reset:

https://github.com/search?l=ruby&q=%22world.reset%22&ref=searchresults&type=Code

And it looks like there are some things relying on it. When we do #1338 we should probably issue a deprecation warning from 2.99 and ensure there's a proper public API to do the resetting off of RSpec.

@JonRowe
Copy link
Member

JonRowe commented Feb 21, 2014

Thank you for taking a stab at this, I have a few bits of feedback and some Q's for @myronmarston about our intent here, as I think some of these are "@public" from a "API we expose to other developers" POV

@myronmarston
Copy link
Member

Thanks for doing this, @alexander-clark!

This actually helped clarify some of my thinking here -- see #1338.

@alexander-clark
Copy link
Contributor Author

No problem. Thanks for the quick feedback. Just had one question, left it as a note at the top since it was related to that thread.

@alexander-clark
Copy link
Contributor Author

Pushed new commit with updates.

JonRowe added a commit that referenced this pull request Feb 23, 2014
documentation for RSpec::Core::World
@JonRowe JonRowe merged commit 97e1fb4 into rspec:master Feb 23, 2014
@JonRowe
Copy link
Member

JonRowe commented Feb 23, 2014

Thanks @alexander-clark

JonRowe added a commit that referenced this pull request Feb 23, 2014
Just dropping some lines off for those settings that are self
explanatory accessors.

[skip ci]
jalkoby pushed a commit to jalkoby/rspec-core that referenced this pull request Mar 5, 2014
Just dropping some lines off for those settings that are self
explanatory accessors.

[skip ci]
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants