Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Josep Jaume Rey
    @josepjaume
    this is
    OMG so awesome
    Josep Jaume Rey
    @josepjaume
    @cibernox did it work?
    Miguel Camba
    @cibernox
    oh sorry, I was with sergio making some insanely hard queries
    yes, it worked
    i have another different problem now
    but the factory_girl thing is solved
    Spritle Software
    @spritle
    Just published a sample rails4 app with spinach.
    Is this the best way to tell travisci to run spinach test ?
    https://github.com/spritlesoftware/eat-spinach-with-rails4/blob/master/.travis.yml
    Josep Jaume Rey
    @josepjaume
    hi @spritle - you could use the spinach executable as well
    we have it like this in our travis config:
    before_script:
      - cp config/database.yml.ci config/database.yml
      - bundle exec rake parallel:create parallel:load_schema parallel:prepare
    script:
      - "bundle exec rake parallel:spec"
      - "bundle exec spinach"
    Spritle Software
    @spritle
    Thanks @josepjaume
    BrandonMathis
    @BrandonMathis
    How to I include the capybara-email DSL in spinach? For cucumber it was World(Capybara::Email::DSL)
    Dawid Gosławski
    @alkuzad
    @BrandonMathis just use include like for normal model
    Nicola
    @nicolaguidi
    Hello everyone! I was about to try Spinach on a rails app but I'm a bit confused (because I'm a noob): for a Rails 4 app, should I simply use gem spinach or gem spinach-rails? If the latter, what does this passage mean in the usage guide: "Follow the instructions from Spinach to set up spinach and run the rake task: RAILS_ENV=test rake spinach "?
    Sorry if the question is dumb 😁
    Dawid Gosławski
    @alkuzad
    spinach-rails will add Rails generators so you can use rake tasks or so on, if you do not use rake and can create support config manually it's not necessary
    I recommend gem 'spinach', github: 'codegram/spinach', branch: 'master', ref: '7b6bfe4c25740d226fcd5d76b7d9f71e851276c1'
    as it's has fix for --generate with --features-path options but it's not necessary
    if you have problems with colors use colorize ~> 0.5.8
    @nicolaguidi
    Nicola
    @nicolaguidi
    Thanks @alkuzad, really helpful. I already tried that and had a problem with the json gem, but haven't created the support config so maybe that's it. I will try again and eventually come back :smile: Have a great day!
    Dave Tapley
    @dukedave
    Hey, is there anything like a .spinachrc file? I'd really like to have -b every time I run.
    Dawid Gosławski
    @alkuzad
    it seems to be loaded every time after standard options: https://github.com/codegram/spinach/blob/master/lib/spinach/cli.rb#L137
    Brian Carlson
    @Carlbc18
    Hi All, this might be a really stupid question... We're using Jenkins for ci, and when our spinach tests run if we have a failure in a before scenario hook our builds are green. I've tried raising the exception or failing, but neither produce a failed build. Spinach Reports are 'green'. I've been looking through the source and I don't see anything obvious. Any thoughts on this?!?!?!
    Dawid Gosławski
    @alkuzad
    @Carlbc18 have you considered using around scenario so you can control the flow more easily ?
    Brian Carlson
    @Carlbc18
    We're using around scenario to do some step filtering on tags
    Does around scenario provide mechanism to fail appropriately that before scenario doesn't?
    Dawid Gosławski
    @alkuzad
    I mean you can raise inside block instead of doing example
    Brian Carlson
    @Carlbc18

    something as simple as this in the before scenario hook i'm not sure how it would possibly change in functionality in the around scenario hook...

    begin
    Capybara.using_wait_time(120) do
    Capybara.find('#app')
    end
    rescue Exception => e
    fail 'some creative message'
    end

    sorry about the poor formatting
    begin Capybara.using_wait_time(120) do Capybara.find('#app') end rescue Exception => e fail 'some creative message' end
    Dawid Gosławski
    @alkuzad
    @Carlbc18 I made simple example with test values and test runs in around scenario but even if it passes the around raises and full return status is 1
    ./features/test.feature
    Feature: test
    
    Scenario: test
     Given I have test var
     Then test var should equal test
    
    ./features/support/env.rb
    require 'spinach'
    
    Spinach.hooks.around_scenario do |a,b, &blk|
      STDERR.puts 'before'
      blk.call
      fail 'some fancy error'
    end
    ./features/steps/test.rb
    class Spinach::Features::Test < Spinach::FeatureSteps
      step 'I have test var' do
        @test = 'test' #pending 'step not implemented'
      end
    
      step 'test var should equal test' do
        fail 'not equal' unless @test == 'test' #pending 'step not implemented'
      end
    end
    If I put exception before blk.call it's propagated up to top and breaks execution like we wanted to
    Brian Carlson
    @Carlbc18
    Thank you. i'll review.
    Dave Tapley
    @dukedave
    @alkuzad good find on config.yml, thanks :)
    Josh Mostafa
    @micapam
    Hi guys. I'm having some trouble generating feature steps with a custom features path.
    [joshua.mostafa@R5003889 ffx-autolie]$ bundle exec spinach --generate --features-path features/sites/horsedeals
    invalid argument - --features-path
    Any ideas why that would fail ?
    Josh Mostafa
    @micapam
    OK I've got it :)
    I should have done:
    [joshua.mostafa@R5003889 ffx-autolie]$ spinach -g features/sites/horsedeals/
    Victor Mours
    @victormours
    Hi there! :smile: spinach seems awesome, and i'm really looking forward to a gherkin-compatible framework with a saner way of defining steps (you had me at modularity <3). I was wondering if you guys were planning on adding support to docstring step arguments anytime soon? (this kind of stuff https://cucumber.io/docs/reference#step-arguments)
    Dave Tapley
    @dukedave
    Not sure if this is within Spinach, but we're using Capybara and would like to assert that certain strings never appear on any page. Is there an appropriate hook for this?
    Graham Jackson
    @gjackson12
    So, Spinach is using Capybara under the hood I assume?
    Actually, that is a dumb assumption. :smile:
    Dawid Gosławski
    @alkuzad
    @gjackson12 Capybara can be used, it's bugged so you can not use debugger though (someone redirected STDOUT to null for no obvious reason). But i.e I use Spinach to test shell integration libraries so it's not needed.
    Bishisht Bhatta
    @bishisht
    hi can someone point me to guard + spinach tutorial?