<commit_before>'use strict';

var chai   = require('chai');
var expect = chai.expect;

var Stats = require('lib/common/components/stats');

var ReadStream  = require('lib/common/streams/read-stream');
var WriteStream = require('lib/common/streams/write-stream');

var SyncWriteStream = require('lib/common/streams/sync-write-stream');

module.exports = function (fs, getElement, version) {

  describe('members', function () {

    it('should expose Stats', function () {
      expect(fs.Stats).to.equal(Stats);
    });

    it('should expose ReadStream', function () {
      expect(fs.ReadStream).to.be.a('function');
      expect(new fs.ReadStream('/file')).to.be.an.instanceof(ReadStream);
    });

    it('should expose WriteStream', function () {
      expect(fs.WriteStream).to.be.a('function');
      expect(new fs.WriteStream('/file')).to.be.an.instanceof(WriteStream);
    });

    if (['v0.10', 'v0.12'].indexOf(version) !== -1) {

      it('should expose SyncWriteStream', function () {
        expect(fs.SyncWriteStream).to.be.a('function');
        expect(new fs.SyncWriteStream('/file')).to.be.an.instanceof(SyncWriteStream);
      });

    }

  });

};
<commit_msg>Add unit test for access flags<commit_after>'use strict';

var chai   = require('chai');
var expect = chai.expect;

var Stats = require('lib/common/components/stats');

var ReadStream  = require('lib/common/streams/read-stream');
var WriteStream = require('lib/common/streams/write-stream');

var SyncWriteStream = require('lib/common/streams/sync-write-stream');

module.exports = function (fs, getElement, version) {

  describe('members', function () {

    it('should expose Stats', function () {
      expect(fs.Stats).to.equal(Stats);
    });

    it('should expose ReadStream', function () {
      expect(fs.ReadStream).to.be.a('function');
      expect(new fs.ReadStream('/file')).to.be.an.instanceof(ReadStream);
    });

    it('should expose WriteStream', function () {
      expect(fs.WriteStream).to.be.a('function');
      expect(new fs.WriteStream('/file')).to.be.an.instanceof(WriteStream);
    });

    if (['v0.10', 'v0.12'].indexOf(version) !== -1) {

      it('should expose SyncWriteStream', function () {
        expect(fs.SyncWriteStream).to.be.a('function');
        expect(new fs.SyncWriteStream('/file')).to.be.an.instanceof(SyncWriteStream);
      });

    }

    if (version !== 'v0.10') {

      it('should expose access flags', function () {
        expect(fs).to.contain.keys([
          'F_OK',
          'R_OK',
          'W_OK',
          'X_OK'
        ]);
      });

    }

  });

};

{'fraction_non_alphanumeric': 0.185, 'fraction_numerical': 0.006538461538461538, 'mean_word_length': 3.270935960591133, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5616255', 'n_tokens_mistral': 847, 'n_tokens_neox': 824, 'n_words': 132}