Giter Club home page Giter Club logo

Comments (5)

ArturT avatar ArturT commented on August 26, 2024

@greggroth Hi, I've just did quick test and pattern works in case when .feature file has rspec tests.

I guess your .feature file has cucumber test inside so in that case you need to generate a separate report for cucumber tests and use cucumber adapter:
https://github.com/ArturT/knapsack#step-for-cucumber

from knapsack.

greggroth avatar greggroth commented on August 26, 2024

The specs are written using the gherkin syntax, but are ran using rspec, e.g. bin/rspec spec/features/logging_in.feature. Would that still require a separate report? I would think it would be included in the rspec report.

https://github.com/jnicklas/turnip

from knapsack.

ArturT avatar ArturT commented on August 26, 2024

Hmm, so it looks like rspec hooks were not fired and that's why report doesn't have .feature files.
https://github.com/ArturT/knapsack/blob/master/lib/knapsack/adapters/rspec_adapter.rb#L9

Maybe you are using a separate spec_helper.rb for .feature and you missed to bind there Knapsack::Adapters::RspecAdapter.

If I will find some time during weekend I can prepare test suite with turnip to debug the problem unless you will figure out it earlier.

from knapsack.

greggroth avatar greggroth commented on August 26, 2024

Thank you for the hint! I dug in and found it's an issue with Knapsack::Adapters::RspecAdapter.test_path's ability to parse the filename from example metadata. This is when running a turnip feature:

pry(#<RSpec::ExampleGroups::REDACTED::REDACTED>)> Knapsack::Adapters::RspecAdapter.test_path(::RSpec.current_example.metadata[:example_group])
=> "/Users/greggory/.gem/ruby/2.2.2/gems/turnip-1.2.4/lib/turnip/rspec.rb"

and with a normal spec file:

[1] pry(#<RSpec::ExampleGroups::REDACTED::REDACTED::REDACTED>)> Knapsack::Adapters::RspecAdapter.test_path(::RSpec.current_example.metadata[:example_group])
=> "./spec/models/user_spec.rb"

I'll dig in further and see if I can't put together a PR to improve this.

from knapsack.

ArturT avatar ArturT commented on August 26, 2024

Cool. You may want to take a look how I get the test file path in other adapters
https://github.com/ArturT/knapsack/tree/master/lib/knapsack/adapters

Please let me know if you will have something. In case you stuck I will help with that.

from knapsack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.