dkornishev / dherkin

Cucumber gherkin runtime for dart
BSD 2-Clause "Simplified" License
8 stars 5 forks source link

Some more fixes #31

Closed Goutte closed 10 years ago

Goutte commented 10 years ago

Refactoring backgrounds and adding RunStatus.failures getter.

Goutte commented 10 years ago

Good job on the boilerplate !


I now have a working (understand: very hackish) feature runner, loading up one tar of the files.

Future<Map<String, String>> fetchFeaturesFromForceServer() {
  String path = "http://localhost:8282";
  Completer fetchDone = new Completer();
  HttpRequest req = new HttpRequest();
  req.overrideMimeType('text/plain; charset=x-user-defined');
  req.open('GET', path + '/jungle/trials.tar');
  req.onLoad.listen((e) {
    if (req.status == 200) {
      // Convert the responseText to binary.
      var bytes = req.responseText.split('').map((e){
        return new String.fromCharCode(e.codeUnitAt(0) & 0xff);
      }).join('').codeUnits;
      // Decode the tar file.
      Archive archive = new TarDecoder().decodeBytes(bytes);
      // Collect the features and complete
      Map<String, String> features = {};
      for (ArchiveFile archiveFile in archive) {
        features[archiveFile.name] = UTF8.decode(archiveFile.content);
      }
      fetchDone.complete(features);
    }
  });
  req.send('');

  return fetchDone.future;
}

Now, it's time for the big guns : endgame score calculus !

dkornishev commented 10 years ago

Can you add a section on using dherkin in dartium? I re-wrote things a bit.

Also, I think library needs to be renamed, just don't know to what.

2014-06-25 23:11 GMT-04:00 Antoine Goutenoir notifications@github.com:

Good job on the boilerplate !

I now have a working (understand: very hackish) feature runner, loading up one tar of the files.

Future<Map<String, String>> fetchFeaturesFromForceServer() { String path = "http://localhost:8282"; Completer fetchDone = new Completer(); HttpRequest req = new HttpRequest(); req.overrideMimeType('text/plain; charset=x-user-defined'); req.open('GET', path + '/jungle/trials.tar'); req.onLoad.listen((e) { if (req.status == 200) { // Convert the responseText to binary. var bytes = req.responseText.split('').map((e){ return new String.fromCharCode(e.codeUnitAt(0) & 0xff); }).join('').codeUnits; // Decode the tar file. Archive archive = new TarDecoder().decodeBytes(bytes); // Collect the features and complete Map<String, String> features = {}; for (ArchiveFile archiveFile in archive) { features[archiveFile.name] = UTF8.decode(archiveFile.content); } fetchDone.complete(features); } }); req.send('');

return fetchDone.future;}

Now, it's time for the big guns : endgame score calculus !

— Reply to this email directly or view it on GitHub https://github.com/dkornishev/dherkin/pull/31#issuecomment-47183575.

Goutte commented 10 years ago

Right now I can't explain how to properly run dherkin in Dartium, there are too much hacks in what I did. When we'll have Runner classes, it'll be different.

Why do you think the library needs to be renamed ? I think dherkin is fine. It's "Gherkin for Dart" ; it's expressive, short, and not already used. What's wrong with it ?

dkornishev commented 10 years ago

Dherkin a little harsh sounding

2014-06-26 10:51 GMT-04:00 Antoine Goutenoir notifications@github.com:

Right now I can't explain how to properly run dherkin in Dartium, there are too much hacks in what I did. When we'll have Runner classes, it'll be different.

Why do you think the library needs to be renamed ? I think dherkin is fine. It's "Gherkin for Dart" ; it's expressive, short, and not already used. What's wrong with it ?

— Reply to this email directly or view it on GitHub https://github.com/dkornishev/dherkin/pull/31#issuecomment-47235500.

dkornishev commented 10 years ago

I pushed fix for Examples being printed. I'd like failed rows to be printed in red, but having trouble figure out best way to determine sub-scenario failures.

2014-06-26 13:18 GMT-04:00 Danil Kornishev danil.kornishev@gmail.com:

Dherkin a little harsh sounding

2014-06-26 10:51 GMT-04:00 Antoine Goutenoir notifications@github.com:

Right now I can't explain how to properly run dherkin in Dartium, there

are too much hacks in what I did. When we'll have Runner classes, it'll be different.

Why do you think the library needs to be renamed ? I think dherkin is fine. It's "Gherkin for Dart" ; it's expressive, short, and not already used. What's wrong with it ?

— Reply to this email directly or view it on GitHub https://github.com/dkornishev/dherkin/pull/31#issuecomment-47235500.