Trying to understanding rules when project has both unit tests and rspec tests

View: New views
4 Messages — Rating Filter:   Alert me  

Trying to understanding rules when project has both unit tests and rspec tests

by Chris Kutler :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I am not sure this is a scenario that would really exist (that
developers would have both unit tests and rspec tests), but I do and I
have some questions.

calendars_controller.rb has
  RSpec > controllers > calendars_controller_spec.rb
  Functional Tests > calendars_controller-test.rb
    Pop-up menu Navigate > Go to Tested Class takes
    me to calendars_controller.rb for both files.

  Pop-up menu Navigate > Go to Test in calendars_controller.rb
    takes me to calendars_controller_spec.rb

  Pop-up menu Test File in calendars_controller.rb
    runs calendars_controller_spec.rb

So, one would think that RSpec files take priority over unit test files.
However, with the model tests, the unit test takes priority.

Models > calendar.rb has
    Unit Test > calendar.rb
    RSpec > models > calendar_spec.rb
       Go to Tested class for both takes me to calendar.rb

    Go to Test takes me to calendar_test.rb, not calendar_spec.rb
   
    Test File runs the calendar_test class, not the calendar_spec test

Why are these different?



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


Re: Trying to understanding rules when project has both unit tests and rspec tests

by Martin Krauskopf :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Chris Kutler wrote:
[...]
> So, one would think that RSpec files take priority over unit test files.
> However, with the model tests, the unit test takes priority.
[...]
> Why are these different?

The underlaying code behaves like that. Seemingly bug, I'll fix it to
prefer the test in all cases when both, rspec and test, are available.

Thanks for the catch,

        m.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


Re: Trying to understanding rules when project has both unit tests and rspec tests

by Martin Krauskopf :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Martin Krauskopf wrote:
> Chris Kutler wrote:
> [...]
>> So, one would think that RSpec files take priority over unit test
>> files. However, with the model tests, the unit test takes priority.
> [...]
>> Why are these different?
>
> The underlaying code behaves like that. Seemingly bug, I'll fix it to
> prefer the test in all cases when both, rspec and test, are available.

Fixed: #c1ef9cda3b00

Will be likely available since build 3614 or later.

        m.



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


Re: Trying to understanding rules when project has both unit tests and rspec tests

by Chris Kutler :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Great! thanks.

Martin Krauskopf wrote:

> Chris Kutler wrote:
> [...]
>> So, one would think that RSpec files take priority over unit test
>> files. However, with the model tests, the unit test takes priority.
> [...]
>> Why are these different?
>
> The underlaying code behaves like that. Seemingly bug, I'll fix it to
> prefer the test in all cases when both, rspec and test, are available.
>
> Thanks for the catch,
>
>     m.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@...
> For additional commands, e-mail: dev-help@...
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...