{"action":"created","issue":{"url":"https://api.github.com/repos/colszowka/simplecov/issues/77","repository_url":"https://api.github.com/repos/colszowka/simplecov","labels_url":"https://api.github.com/repos/colszowka/simplecov/issues/77/labels{/name}","comments_url":"https://api.github.com/repos/colszowka/simplecov/issues/77/comments","events_url":"https://api.github.com/repos/colszowka/simplecov/issues/77/events","html_url":"https://github.com/colszowka/simplecov/issues/77","id":1637505,"number":77,"title":"simplecov shows 0.0%","user":{"login":"isel","id":411682,"avatar_url":"https://avatars.githubusercontent.com/u/411682?v=3","gravatar_id":"","url":"https://api.github.com/users/isel","html_url":"https://github.com/isel","followers_url":"https://api.github.com/users/isel/followers","following_url":"https://api.github.com/users/isel/following{/other_user}","gists_url":"https://api.github.com/users/isel/gists{/gist_id}","starred_url":"https://api.github.com/users/isel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/isel/subscriptions","organizations_url":"https://api.github.com/users/isel/orgs","repos_url":"https://api.github.com/users/isel/repos","events_url":"https://api.github.com/users/isel/events{/privacy}","received_events_url":"https://api.github.com/users/isel/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/colszowka/simplecov/labels/Support","name":"Support","color":"d7e102"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2011-09-13T20:07:09Z","updated_at":"2016-09-27T16:45:01Z","closed_at":"2011-09-20T06:44:55Z","body":"We are trying to use simplecov with rspec from within a rake task. we have tried in Windows and ubuntu, but it always shows 0.0%, like this:\r\n```\r\n  root@ip-10-81-10-196:~# rake\r\n  /opt/rvm/rubies/ruby-1.9.2-head/bin/ruby -S rspec test_spec.rb\r\n  .\r\n  Finished in 0.00039 seconds\r\n    1 example, 0 failures\r\n  Coverage report generated for RSpec to /root/coverage. 0 / 0 LOC (0.0%) covered.\r\n```\r\n\r\nwe are not using bundler, we installed simplecov 0.5.2 and rspec 2.6.0 via \"gem install\". \r\n\r\nrakefile.rb has:\r\n\r\n  require 'simplecov'\r\n  SimpleCov.start\r\n\r\n  require 'rake'\r\n  require 'rspec/core/rake_task'\r\n\r\n  RSpec::Core::RakeTask.new(:spec) do |t|\r\n    t.pattern = '*_spec.rb'\r\n  end\r\n\r\n  task :default => :spec\r\n\r\nand test_spec.rb has:\r\n\r\n  require 'rspec'\r\n\r\n  class TestClass\r\n    attr_reader :text\r\n\r\n    def initialize(text)\r\n      @text = text\r\n    end\r\n  end\r\n\r\n  describe \"a simple test\" do\r\n    it \"should be covered\" do\r\n      test_class = TestClass.new('default text')\r\n      test_class.text.should == 'default text'\r\n    end\r\n  end\r\n\r\nHow do we make it work?\r\n\r\nthank you so much,\r\n\r\nIsel"},"comment":{"url":"https://api.github.com/repos/colszowka/simplecov/issues/comments/249923974","html_url":"https://github.com/colszowka/simplecov/issues/77#issuecomment-249923974","issue_url":"https://api.github.com/repos/colszowka/simplecov/issues/77","id":249923974,"user":{"login":"sebasjimenez10","id":1844582,"avatar_url":"https://avatars.githubusercontent.com/u/1844582?v=3","gravatar_id":"","url":"https://api.github.com/users/sebasjimenez10","html_url":"https://github.com/sebasjimenez10","followers_url":"https://api.github.com/users/sebasjimenez10/followers","following_url":"https://api.github.com/users/sebasjimenez10/following{/other_user}","gists_url":"https://api.github.com/users/sebasjimenez10/gists{/gist_id}","starred_url":"https://api.github.com/users/sebasjimenez10/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebasjimenez10/subscriptions","organizations_url":"https://api.github.com/users/sebasjimenez10/orgs","repos_url":"https://api.github.com/users/sebasjimenez10/repos","events_url":"https://api.github.com/users/sebasjimenez10/events{/privacy}","received_events_url":"https://api.github.com/users/sebasjimenez10/received_events","type":"User","site_admin":false},"created_at":"2016-09-27T16:45:01Z","updated_at":"2016-09-27T16:45:01Z","body":"I'm using Simple Cov without any framework just plain ruby classes. I wanted to see how the coverage was and I had the 0 lines covered issue.\r\n\r\nI was able to solve this mixing @isel, @jokeyrhyme an d @ahamid solutions. Here's my example:\r\n\r\n```\r\nrequire 'simplecov'\r\nSimpleCov.start do\r\n  @filters = []\r\nend\r\n\r\nrequire 'minitest/autorun'\r\n```\r\n\r\nI needed to set the filters to an empty array and also require simplecov before requiring minitest/autorun.\r\n\r\nHope this helps anyone."}}
{"actor":{"display_login":"sebasjimenez10"}}