Questions tagged [spinach]

Spinach is a BDD framework for Ruby, built on top of Gherkin.

Spinach is a BDD framework for Ruby, built on top of Gherkin.

Written in pure Ruby, it is "a high-level BDD framework that leverages the expressive Gherkin language (used by Cucumber) to help you define executable specifications of your application or library's acceptance criteria."

It was conceived as an alternative to Cucumber, with step maintainability and step reusability as some of its design goals. It features encapsulation and modularity of step definitions.

Rails support is available via a compatibility layer called spinach-rails.

Website | GitHub repository | RubyDoc site

14 questions
18
votes
1 answer

ChromeDriver/Spinach/Selenium error: Failed to read the 'localStorage' property from 'Window': Storage is disabled inside 'data:' URLs

I am getting an error with my spinach tests (Ruby on Rails). Every test fails for the same reason: : Failed to read the 'localStorage' property from 'Window': Storage is disabled inside 'data:' URLs. (Session info:…
3
votes
3 answers

Is There a Way to Discard Empty Captures?

Is there a built in way to iterate over non-empty captures only or do I need to use a lambda/modify my regex? For example, given: const auto input = "Peas&Carrots Spinach-Casserole Beets Pizza Spinach-Salad Coleslaw"s I'd like to find foods that…
Jonathan Mee
  • 37,899
  • 23
  • 129
  • 288
3
votes
2 answers

How to speed up first request for local Rails UI tests

I am using spinach, Capybara, and Poltergeist together to write automated UI tests. I have been trying to speed up running tests locally. I am using Spring which helps a little with the environment loading. However, the first request (visit) to the…
gabe
  • 1,873
  • 2
  • 20
  • 36
2
votes
0 answers

Explicitly verifying a mocha expectation after it's been called

I am using Mocha::Hooks#mocha_verify in the after_scenario spinach hook which works fine for some cases. However, there are many times when I want to verify an expectation after a value has been updated on a piece of data. For example, class MyModel…
gabe
  • 1,873
  • 2
  • 20
  • 36
2
votes
1 answer

cucumber vs spinach in term of speed

I'm evaluating cucumber for testing, but the speed of execution is too slow. I've found Spinach but am wondering how they compare speedwise.
cfpete
  • 4,143
  • 8
  • 27
  • 23
1
vote
1 answer

Running spinach tests in parallel

I am moving from Cucumber to Spinach for BDD on my rails 4 project. According to parallel-tests documentation on https://github.com/grosser/parallel_tests it should support spinach rake parallel:features-spinach # Spinach but I got that…
1
vote
1 answer

random data production in feature steps

class Spinach::Features::Signup < Spinach::FeatureSteps attr_accessor :valid_attributes before do valid_attributes = Fabricate.attributes_for(:identity) #@valid_attributes = Fabricate :identity end step 'I am a visitor' do …
0
votes
1 answer

Test react components in Rails with capybara/spinach

I'm building a Rails app which uses React components for layouts, here you can see an example .pure-g.homepage = react_component("SectionA", {foo: @bar}, class: "pure-u-1") = react_component("SectionB", {foo: @bar}, class: "pure-u-1") =…
Alexander Pulido
  • 114
  • 1
  • 10
0
votes
1 answer

How do I run all Spinach features which use a specific step?

When changing Spinach step defined in a Spinach steps file, it is useful to run all those features which use that step. e.g: I have step 'I have an empty array' do.. defined in features/steps/test_how_spinach_works.rb I would like to run spinach…
davetapley
  • 17,000
  • 12
  • 60
  • 86
0
votes
1 answer

Ruby Spinach Html Result Page

I've just started looking at the Spinach BDD framework and one thing I'd really like to do is to have a results HTML page generated similar to the rspec options: --format html --out rspec_results.html Does anyone know of a way to achieve this with…
mvcNewbie
  • 520
  • 1
  • 11
  • 23
0
votes
1 answer

guard-spinach - causes `rails server` errors

Didn't find any solution for this. I'm getting require: cannot load such file -- guard/guard (LoadError) error when i'm trying to start rails server. ruby -v ruby 2.1.2p95 (2014-05-08) [x86_64-linux-gnu] rails -v Rails 4.2.0 gem -v 2.2.2 That's…
plunntic iam
  • 964
  • 1
  • 9
  • 18
0
votes
1 answer

Call one step from within another, Spinach

I recall there being a way to execute a step from within another step using spinach. As I recall, such a step would appear similar to the following: ... step "I create a patient as a facility's administrator" do %Q{ Given I am a facility's…
rthbound
  • 1,323
  • 1
  • 17
  • 24
-3
votes
1 answer

Is there any spinach for DotNet?

I'm interested in testing Spinach on .Net, does anybody knows if there is any frameworks based on it for .Net?
CloudyMarble
  • 36,908
  • 70
  • 97
  • 130