Sha256: 32b9525d7a6ebb169e65d21a414c59c9b9440b2116aea0e297565c8c41bebc2b

Contents?: true

Size: 1.35 KB

Versions: 28

Compression:

Stored size: 1.35 KB

Contents

describe 'Smalruby.SourceCode', ->
  klass = Smalruby.SourceCode
  self = null

  describe '#getRbxmlFilename', ->
    describe 'filenameが01.rbのとき', ->
      beforeEach ->
        self = new klass
          filename: '01.rb'
          data: 'puts "Hello, World!"'

      it '01.rb.xmlを返すこと', ->
        expect(self.getRbxmlFilename()).to.equal('01.rb.xml')

    describe 'filenameが01のとき', ->
      beforeEach ->
        self = new klass
          filename: '01'
          data: 'puts "Hello, World!"'

      it '01.rb.xmlを返すこと', ->
        expect(self.getRbxmlFilename()).to.equal('01.rb.xml')

    describe 'filenameが01.xmlのとき', ->
      beforeEach ->
        self = new klass
          filename: '01.xml'
          data: 'puts "Hello, World!"'

      it '01.rb.xmlを返すこと', ->
        expect(self.getRbxmlFilename()).to.equal('01.rb.xml')

    describe 'filenameが01.rb.xmlのとき', ->
      beforeEach ->
        self = new klass
          filename: '01.rb.xml'
          data: 'puts "Hello, World!"'

      it '01.rb.xmlを返すこと', ->
        expect(self.getRbxmlFilename()).to.equal('01.rb.xml')

  describe '.defaultFilename', ->
    it 'program_<日付>.rbを返すこと', ->
      now = new Date(2015, 2 - 1, 10, 12, 10, 59)
      expect(Smalruby.SourceCode.defaultFilename(now)).to.equal('program_150210_121059.rb')

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
smalruby-editor-0.4.1-x86-mingw32 spec/javascripts/models/source_code_spec.coffee
smalruby-editor-0.4.2-x86-mingw32 spec/javascripts/models/source_code_spec.coffee
smalruby-editor-0.4.2 spec/javascripts/models/source_code_spec.coffee
smalruby-editor-0.4.1 spec/javascripts/models/source_code_spec.coffee
smalruby-editor-0.4.0-x86-mingw32 spec/javascripts/models/source_code_spec.coffee
smalruby-editor-0.4.0 spec/javascripts/models/source_code_spec.coffee
smalruby-editor-0.3.5-x86-mingw32 spec/javascripts/models/source_code_spec.coffee
smalruby-editor-0.3.5 spec/javascripts/models/source_code_spec.coffee
smalruby-editor-0.3.4-x86-mingw32 spec/javascripts/models/source_code_spec.coffee
smalruby-editor-0.3.4 spec/javascripts/models/source_code_spec.coffee
smalruby-editor-0.3.3-x86-mingw32 spec/javascripts/models/source_code_spec.coffee
smalruby-editor-0.3.3 spec/javascripts/models/source_code_spec.coffee
smalruby-editor-0.3.2-x86-mingw32 spec/javascripts/models/source_code_spec.coffee
smalruby-editor-0.3.2 spec/javascripts/models/source_code_spec.coffee
smalruby-editor-0.3.1-x86-mingw32 spec/javascripts/models/source_code_spec.coffee
smalruby-editor-0.3.1 spec/javascripts/models/source_code_spec.coffee
smalruby-editor-0.3.0-x86-mingw32 spec/javascripts/models/source_code_spec.coffee
smalruby-editor-0.3.0 spec/javascripts/models/source_code_spec.coffee
smalruby-editor-0.2.7-x86-mingw32 spec/javascripts/models/source_code_spec.coffee
smalruby-editor-0.2.7 spec/javascripts/models/source_code_spec.coffee