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

Unfortunate require in Rakefile (profile task), affect specs #92

Closed
dentarg opened this issue Sep 13, 2016 · 2 comments
Closed

Unfortunate require in Rakefile (profile task), affect specs #92

dentarg opened this issue Sep 13, 2016 · 2 comments

Comments

@dentarg
Copy link
Collaborator

dentarg commented Sep 13, 2016

In our Rakefile we have a task that does require_relative "lib/twingly/url":

namespace :profile do
  require_relative "profile/profile"

  desc "Profile"
  task :normalize do |task|
    require_relative "lib/twingly/url"

    Profile.measure "normalizing a short URL", 1000 do
      Twingly::URL.parse('http://www.duh.se/').normalized
    end
  end
end

This require could hide problems that we try to catch in our tests, because even if we wont run that particular task, the require is evaluated when doing anything with rake, like running our specs.

@dentarg dentarg added the bug label Sep 13, 2016
@dentarg
Copy link
Collaborator Author

dentarg commented Sep 13, 2016

E.g. commenting out require_relative "../url" in lib/twingly/url/null_rull.rb when having the above require in the Rakefile, all NullURL specs passes. They should fail, which they do if the require in the Rakefile is also commented out.

@dentarg dentarg added enhancement and removed bug labels Sep 15, 2016
@dentarg dentarg changed the title Unfortunate require in Rakefile (profile task) Unfortunate require in Rakefile (profile task), affect specs Sep 15, 2016
@dentarg
Copy link
Collaborator Author

dentarg commented Nov 5, 2016

In #102 I had to move the profile/profile require and make the gemspec not add ruby-prof as an (dev) dependency for the java platform (jruby).

But ruby-prof are problematic even on ruby-head (wont install, see recent travis builds).

I suggest we move the profile stuff to a sub-dir with it's own Gemfile.

dentarg added a commit that referenced this issue Nov 5, 2016
Was problematic for a number of reasons, see #92.

Close #92.
@dentarg dentarg added the small label Nov 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant