Sha256: f23b4de4195a66b714e979f2fa24e1112ac6dbe9b35f79f1a2212771dc52fd63

Contents?: true

Size: 829 Bytes

Versions: 7

Compression:

Stored size: 829 Bytes

Contents

require 'spec_helper'
require 'my_scripts/scripts/shared'

module MyScriptsTest

  describe MyScripts::Msdn do
    before(:each) do
      @name  = 'msdn'
    end

    context 'With explicit infile, no outfile' do

      it 'reads from infile, writes to stdout' do
        test_files(@name).each do |infile, outfile|
          create_cli
          stdout_should_receive outfile.readlines.map(&:chomp).join("\n") + "\n"
          cli "#{@name} #{infile}", infile
        end
      end
    end

    it 'reads from temp file' do
      text = test_files(@name)[1].first.read
      temp_file = File.expand_path('/tmp/msdn_temp_file')
      File.open(temp_file, 'w') do |f| f.write(text) end

      lambda{@changed_text = `msdn /tmp/msdn_temp_file`}.should_not raise_error
      # puts "\n\nResult: #{@changed_text}"
    end

  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
my_scripts-0.1.13 spec/my_scripts/scripts/msdn_spec.rb
my_scripts-0.1.12 spec/my_scripts/scripts/msdn_spec.rb
my_scripts-0.1.11 spec/my_scripts/scripts/msdn_spec.rb
my_scripts-0.1.10 spec/my_scripts/scripts/msdn_spec.rb
my_scripts-0.1.9 spec/my_scripts/scripts/msdn_spec.rb
my_scripts-0.1.8 spec/my_scripts/scripts/msdn_spec.rb
my_scripts-0.1.7 spec/my_scripts/scripts/msdn_spec.rb