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

Logs are not generated properly on using shoulda matchers or included tests #901

Open
yasirazgar opened this issue Apr 25, 2023 · 0 comments · May be fixed by #902
Open

Logs are not generated properly on using shoulda matchers or included tests #901

yasirazgar opened this issue Apr 25, 2023 · 0 comments · May be fixed by #902

Comments

@yasirazgar
Copy link

Example
Senario 1:

On using shoulda matchers

test/models/account_feat_test.rb

require 'test_helper'

class AccountFeatTest < ActiveSupport::TestCase
  should have_db_column :name
  should have_db_column :display_name
  should have_db_column :description_on
  should have_db_column :description_off

  should have_many :account_feat_statuses

end

Generates following logs

/Users/mdyasir/.rvm/gems/ruby-3.1.3@isamp/gems/shoulda-context-1.2.2/lib/shoulda/context/context.rb:0.08

Senario 2:

test/models/parser_test.rb

require 'test_helper'

class ParserTest < ActiveSupport::TestCase
  include BehaviourTestBase

  setup do
    @setup = true
  end
end

test/helpers/behaviour_test_base.rb

module BehaviourTestBase
  extend ActiveSupport::Concern
  included do
    context 'email location' do
      setup do
        @location = 'Fredericton'
      end

      context 'only note in reply' do
        should 'create note for crm account' do
          assert @location
        end
      end
    end
  end
end

When I run test/models/parser_test.rb tt generates logs as follows, whereas it should be test/models/parser_test.rb:8.79

test/helpers/behaviour_test_base.rb:8.79

@yasirazgar yasirazgar linked a pull request Apr 25, 2023 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant