  @Test
  public void analyse() throws FileNotFoundException {

    DefaultFileSystem fs = new DefaultFileSystem(TEST_DIR);
    tester.setFileSystem(fs);
    DefaultInputFile inputFile = new DefaultInputFile("key", "smallFile.lua")
      .setType(InputFile.Type.MAIN)
      .setLanguage(Lua.KEY)
      .initMetadata(new FileMetadata().readMetadata(new FileReader(new File(TEST_DIR, "smallFile.lua"))));
    fs.add(inputFile);
    inputFile = new DefaultInputFile("key", "bom.lua")
      .setType(InputFile.Type.MAIN)
      .setLanguage(Lua.KEY)
      .initMetadata(new FileMetadata().readMetadata(new FileReader(new File(TEST_DIR, "bom.lua"))));
    fs.add(inputFile);

    sensor.execute(tester);

    String componentKey = "key:smallFile.lua";
    assertThat(tester.measure(componentKey, CoreMetrics.COMPLEXITY_IN_CLASSES).value()).isEqualTo(0);
    assertThat(tester.measure(componentKey, CoreMetrics.NCLOC).value()).isEqualTo(4);
    assertThat(tester.measure(componentKey, CoreMetrics.COMMENT_LINES).value()).isEqualTo(1);
    assertThat(tester.measure(componentKey, CoreMetrics.STATEMENTS).value()).isEqualTo(0);
    assertThat(tester.measure(componentKey, CoreMetrics.FUNCTIONS).value()).isEqualTo(3);

    assertThat(tester.measure(componentKey, CoreMetrics.COMPLEXITY).value()).isEqualTo(4);
    assertThat(tester.measure(componentKey, CoreMetrics.FILE_COMPLEXITY_DISTRIBUTION).value()).isEqualTo("0=1;5=0;10=0;20=0;30=0;60=0;90=0");
    assertThat(tester.measure(componentKey, CoreMetrics.FUNCTION_COMPLEXITY_DISTRIBUTION).value()).isEqualTo("1=2;2=0;4=1;6=0;8=0;10=0;12=0");

   
  }