Package gherkin

Examples of gherkin.I18n


  public void configureRules() {
   
    validateIsoCode();
   
    i18n = new I18n(_code);
   
    IToken keyword= new Token(new TextAttribute(manager.getColor(IGherkinColorConstants.KEYWORD)));
    IToken tag= new Token(new TextAttribute(manager.getColor(IGherkinColorConstants.KEYWORD)));
    IToken step= new Token(new TextAttribute(manager.getColor(IGherkinColorConstants.STEP)));
    IToken string= new Token(new TextAttribute(manager.getColor(IGherkinColorConstants.STRING)));
View Full Code Here


            if (matcher.find()) {
                key = matcher.group(2);
                break;
            }
        }
        return new I18n(key);
    }
View Full Code Here

import org.junit.Test;

public class gherkinTest {

  @Test public void can_create_gherkin_i18n_for_en() {
    gherkin.I18n gherkin = new I18n("en");
    Assert.assertTrue("code is en but was " + gherkin.getIsoCode(), gherkin.getIsoCode().equals("en"));
  }
View Full Code Here

    gherkin.I18n gherkin = new I18n("en");
    Assert.assertTrue("code is en but was " + gherkin.getIsoCode(), gherkin.getIsoCode().equals("en"));
  }
 
  @Test public void code_keywords_for_english_contains_When() {
    gherkin.I18n gherkin = new I18n("en");
    List<String> codeKeywords = gherkin.getCodeKeywords();
    Assert.assertTrue(codeKeywords.contains("When"));
   
  }
View Full Code Here

    Assert.assertTrue(codeKeywords.contains("When"));
   
  }
 
  @Test public void step_keywords_for_english_contains_star() {
    gherkin.I18n gherkin = new I18n("en");
    List<String> stepKeywords = gherkin.getStepKeywords();
    Assert.assertTrue(stepKeywords.contains("* "));
   
  }
 
View Full Code Here

    List<String> stepKeywords = gherkin.getStepKeywords();
    Assert.assertTrue(stepKeywords.contains("* "));
   
  }
  @Test public void _keywords_for_english_contains_dWhen() {
    gherkin.I18n gherkin = new I18n("en_PIRATE");
    List<String> codeKeywords = gherkin.getCodeKeywords();
    List<String> stepKeywords = gherkin.getStepKeywords();
    String keywordTable = gherkin.getKeywordTable();
    Assert.assertTrue(codeKeywords.contains("When"));   
  }
View Full Code Here

    String keywordTable = gherkin.getKeywordTable();
    Assert.assertTrue(codeKeywords.contains("When"));   
  }
 
  @Test public void keywords_for_norway_contains_Egenskap_for_eature() {
    gherkin.I18n gherkin = new I18n("no");
    List<String> keywords = gherkin.keywords("feature");
    Assert.assertTrue(keywords.contains("Egenskap"));   
  }
View Full Code Here

    List<String> keywords = gherkin.keywords("feature");
    Assert.assertTrue(keywords.contains("Egenskap"));   
  }
 
  @Test public void keywords_for_germany_contains_Egenskap_for_eature() {
    gherkin.I18n gherkin = new I18n("de");
    List<String> keywords = gherkin.keywords("feature");
    String keywordTable = gherkin.getKeywordTable();
    int i =0;
//    Assert.assertTrue(keywords.contains("Egenskap"));   
  }
View Full Code Here

//    Assert.assertTrue(keywords.contains("Egenskap"));   
  }

 
  @Test public void code_keywords_for_english_does_not_contains_nonsense() {
    gherkin.I18n gherkin = new I18n("en");
    List<String> codeKeywords = gherkin.getCodeKeywords();
    Assert.assertFalse(codeKeywords.contains("nonsense"));
   
  }
View Full Code Here

    }
  }
 
  private Pattern getLanguageKeyWordMatcher(String languageCode) {
    try {
      I18n i18n = new I18n(languageCode.toLowerCase());
     
      StringBuilder sb = new StringBuilder();
      sb.append("(?:");
      String delim = "";
   
      for(String keyWord : i18n.getCodeKeywords()) {
        sb.append(delim).append(keyWord);
        delim = "|";
      }
   
      return Pattern.compile((sb.append(") (.*)$").toString()));
 
View Full Code Here

TOP

Related Classes of gherkin.I18n

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.