代码之家  ›  专栏  ›  技术社区  ›  american-ninja-warrior

ruby:使用spec测试时给出的最小编写设置

  •  0
  • american-ninja-warrior  · 技术社区  · 10 年前

    在ruby(而不是rails)中进行测试时,我是ruby

    我有一个空文件夹叫做基础设施。它有一个名为spec的文件夹。 其中有一个名为features的文件夹。在这方面,我有一个叫做foo的特性,如下所示:

    ~/gray/infrastructure (master *)[]$ cat spec/features/foo.feature 
    Scenario: View last incidents
      Given Linda is logged in # This will in fact invoke 2 step definitions
      When I go to the incident page
    

    运行spec命令时,将忽略要素文件。 我错过了什么?

    fyi这是我的宝石环境:

    ~/gray/infrastructure (master *)[]$ rvm-prompt
    ruby-2.3.0-preview1@infrastructure
    ~/gray/infrastructure (master *)[]$ gem list
    
    *** LOCAL GEMS ***
    
    bigdecimal (1.2.7)
    builder (3.2.2)
    bundler-unload (1.0.2)
    cucumber (2.3.2)
    cucumber-core (1.4.0)
    cucumber-wire (0.0.1)
    did_you_mean (1.0.0.beta3)
    diff-lcs (1.2.5)
    executable-hooks (1.3.2)
    gem-wrappers (1.2.7)
    gherkin (3.2.0)
    io-console (0.4.3)
    json (1.8.2)
    minitest (5.8.2)
    multi_json (1.11.2)
    multi_test (0.1.2)
    net-telnet (0.1.1)
    power_assert (0.2.6)
    psych (2.0.14)
    rake (10.4.2)
    rdoc (4.2.0)
    rspec (3.4.0)
    rspec-core (3.4.4)
    rspec-expectations (3.4.0)
    rspec-mocks (3.4.1)
    rspec-support (3.4.1)
    rubygems-bundler (1.4.4)
    rvm (1.11.3.9)
    test-unit (3.1.5)
    
    1 回复  |  直到 10 年前
        1
  •  0
  •   Thomas Walpole    10 年前

    您编写了黄瓜特性,而不是RSpec特性测试。黄瓜特性应该放在一个名为features的文件夹中,与spec文件夹处于同一级别。他们用 cucumber 不 spec