Individual test with rspec
Hi everybody,
I'm trying to do a single test into a battery of tests using rspec but I'm no having success.
When I edit the configuration of the single test (Run->Edit Configurations->RSpec) I check that the field 'Exaple Name' is 'DescribeTest.find' without a white space. I manually change the content of the field 'Example Name' to 'DescribeTest .find' with blank space and it passes the tests.
Here the used commands:
Working
rspec apache_values_dao_module_spec.rb --require teamcity/spec/runner/formatter/teamcity/formatter --format Spec::Runner::Formatter::TeamcityFormatter --example "ApacheValuesDao .find"
Not Working
rspec apache_values_dao_module_spec.rb --require teamcity/spec/runner/formatter/teamcity/formatter --format Spec::Runner::Formatter::TeamcityFormatter --example ApacheValuesDao.find
I use RubyMine 7.1.4 (last), RSpec 3.3.2 (last).
Is it a bug of RubyMine? Can I change something inside the IDE to fix this?
Thank you!
Juamna
Please sign in to leave a comment.
Hello!
Could you please attach your apache_values_dao_module_spec.rb? (at least, its part with the code in question)
Hello! and than you for your help!
Here is one of the tests that I am running:
But It happens with every test I execute, I cannot run ir individually, but if I run all the tests I can see the results...
Thank you again!
For provided code sample RubyMine creates run configuration with parameter
--example "valid error_document_500"
which runs only test scenarios with name prefix "valid error_document_500". So if you have another tests named like
"valid error_document_5000" or "valid error_document_500 check" they will be started too.
The question is - do you have tests that doesn't match to the prefix "valid error_document_500" but started even when option
--example "valid error_document_500"
provided
Hello guys!
Actually you are giving me some light to this issue!
I have discovered I don't have problems with tests wich describe definition do not start with '#'...
I have problems with the tests that the description of the describe starts with '#' like the aexample above:
Does the character '#' makes the execution of the single test fail?
Thank you again!
I didn't find any specific meaning of symbol # when run rspec. But found another way to see several test started when you run only one.
In this example when you try to start describe '#is_valid?' both test would start.
The first test would start because describe contains the value and the second would start because it 'should return update_date when #is_valid? false' contains the value too