zoukankan      html  css  js  c++  java
  • cucumber系列(一) 如何让cucumber识别中文

    1,由于有时候找不到对应的英文描述现有产品的一些功能,所以准备支持中文来写cucumber 框架。

    在命令行执行如下命令可查看在写feature文档时的关键字对应,如“功能”,”背景“,”假如“等等。

    #cucumber --i18n zh-CN 
          | feature          | "功能"       |  
          | background       | "背景"       |  
          | scenario         | "场景"       |  
          | scenario_outline | "场景大纲"    |  
          | examples         | "例子"       |  
          | given            | "* ", "假如" |  
          | when             | "* ", "当"   |  
          | then             | "* ", "那么" |  
          | and              | "* ", "而且" |  
          | but              | "* ", "但是" |  
          | given (code)     | "假如"       |  
          | when (code)      | "当"         |  
          | then (code)      | "那么"       |  
          | and (code)       | "而且"       |  
          | but (code)       | "但是"       | 

    2, 在feature文件里的第一行要写 language:zh-CN, 不然cucumber无法认出中文

    #language: zh-CN

    3, 当然同时在rb文件里头部加上

    #encoding:utf-8

  • 相关阅读:
    PL/SQL 中查询CLOB字段内容
    ubuntu14.04 swap not avalible交换分区不能使用
    ubuntu14.04安装ia32-lib
    rtems资料分享
    NIR相机
    rsync详解
    SublimeText3使用技巧总结
    msm8610 lcd driver code analysis
    Qualcomm Android display架构分析
    LCD framebuffer驱动设计文档
  • 原文地址:https://www.cnblogs.com/mover/p/3671114.html
Copyright © 2011-2022 走看看