Sha256: 732f25311d250e098204a2f4727125722d16a771abd2f5bb33620123089bf2e1

Contents?: true

Size: 939 Bytes

Versions: 4

Compression:

Stored size: 939 Bytes

Contents

#!/usr/bin/env ruby
require 'rubygems'; require 'require_relative'
require_relative './mock-helper'
require_relative './cmd-helper'
require_relative '../../processor/command/edit'

class TestCommandEdit < Test::Unit::TestCase
  include MockUnitHelper
  def setup
    @name = File.basename(__FILE__, '.rb').split(/-/)[2]
    $msgs = []
    $errmsgs = []
    common_setup(@name)
    def @cmd.msg(message)
      $msgs << message
    end
    def @cmd.errmsg(message)
      $errmsgs << message
    end
  end

  def test_basic
    old_editor = ENV['EDITOR']
    ENV['EDITOR'] = '#'
    base_file = File.basename(__FILE__)
    @cmd.proc.settings[:basename] = true
    @cmd.run([@name])
    assert_equal "Running # +7 \"mock-helper.rb\"...", $msgs[-1]
    @cmd.run([@name, 8])
    assert_equal "Running # +8 \"mock-helper.rb\"...", $msgs[-1]
    @cmd.run([@name, __FILE__])
    assert_equal "Running # +1 \"#{base_file}\"...", $msgs[-1]
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rbx-trepanning-0.2.1-universal-rubinius-2.0 test/unit/test-cmd-edit.rb
rbx-trepanning-0.2.1-universal-rubinius-1.2 test/unit/test-cmd-edit.rb
rbx-trepanning-0.2.0-universal-rubinius-2.0 test/unit/test-cmd-edit.rb
rbx-trepanning-0.1.0-universal-rubinius-1.2 test/unit/test-cmd-edit.rb