Sha256: 9d0dfaf311eb12e7a10080af4ddf7f08d252970de26becf8cbe7b3f10a93da2f

Contents?: true

Size: 1.79 KB

Versions: 1

Compression:

Stored size: 1.79 KB

Contents

require 'spec_helper'

module InfinityTest
  describe Command do
    
    it "should pass the ruby version and set" do
      Command.new(:ruby_version => '1.9.2').ruby_version.should == '1.9.2'
    end

    it "should pass the ruby version and set" do
      Command.new(:ruby_version => 'JRuby 1.3.5').ruby_version.should == 'JRuby 1.3.5'
    end

    it "should create and set the command" do
      Command.new(:command => 'rspec spec').command.should == 'rspec spec'
    end
    
    it "should create and set the command for ruby version" do
      Command.new(:command => 'spec spec').command.should == 'spec spec'      
    end
    
    it "should have the results as Array" do
      Command.new.results.should be_instance_of(Array)
    end
    
    it "should have the line variable as Array" do
      Command.new.line.should be_instance_of(Array)
    end

    describe '#push_in_the_results' do
      
      before do
        @command = Command.new
      end
      
      it "should parse correct the results when have in the ree" do
        @command.line = [27, 91, 51, 51, 109, 49, 50, 49, 32, 101, 120, 97, 109, 112, 108, 101, 115, 44, 32, 48, 32, 102, 97, 105, 108, 117, 114, 101, 115, 44, 32, 50, 32, 112, 101, 110, 100, 105, 110, 103, 27, 91, 48, 109, 10]
        @command.should_receive(:ree?).and_return(true)
        @command.push_in_the_results(?\n)
        @command.results.should == ["\e[33m121 examples, 0 failures, 2 pending\e[0m\n"]
      end
      
      it "should parse correct the results in ruby 1.8" do
        @command.line = [46, 46, 46, 46, 46, 42, 46, 42]
        @command.should_receive(:ree?).and_return(false)        
        @command.should_receive(:mri?).and_return(true)
        @command.push_in_the_results(?\n)
        @command.results.should == [".....*.*"]
      end
      
    end
    
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
infinity_test-0.2.0 spec/infinity_test/command_spec.rb