Sha256: 1f8d678336b9a37fd01d3b09232d889967120be77044926976d707e61400cc91

Contents?: true

Size: 1.94 KB

Versions: 23

Compression:

Stored size: 1.94 KB

Contents

require 'spec_helper'
require 'mocha'

describe 'Svn::Activity' do
  describe 'cat' do
    let(:commit_1) { OhlohScm::Commit.new(token: 1) }
    let(:hello_diff) { OhlohScm::Diff.new(path: 'helloworld.c') }

    it 'must export data correctly' do
      with_svn_repository('svn') do |svn|
        tmpdir do |dir|
          svn.activity.export(dir)
          Dir.entries(dir).sort.must_equal %w[. .. branches tags trunk]
        end
      end
    end

    it 'must export tags correctly' do
      with_svn_repository('svn', 'trunk') do |svn|
        tmpdir do |svn_working_folder|
          tmpdir('oh_scm_out_dir_') do |dir|
            root_path = svn.activity.root
            folder_name = root_path.slice(/[^\/]+\/?\Z/)
            cmd = "cd #{svn_working_folder} && svn co #{root_path} && cd #{folder_name}"\
                  " && mkdir -p #{root_path.gsub(/^file:../, '')}/db/transactions"\
                  " && svn copy trunk tags/2.0 && svn commit -m 'v2.0' && svn update"
            svn.activity.send :run, cmd

            svn.activity.export_tag(dir, '2.0')

            Dir.entries(dir).sort.must_equal %w[. .. COPYING README helloworld.c makefile]
          end
        end
      end
    end

    it 'must get tags correctly' do
      with_svn_repository('svn', 'trunk') do |svn|
        tmpdir do |svn_working_folder|
          root_path = svn.activity.root
          folder_name = root_path.slice(/[^\/]+\/?\Z/)
          cmd = "cd #{svn_working_folder} && svn co #{root_path} && cd #{folder_name}"\
                " && mkdir -p #{root_path.gsub(/^file:../, '')}/db/transactions"\
                " && svn copy trunk tags/2.0 && svn commit -m 'v2.0' && svn update"
          svn.activity.send :run, cmd

          svn.activity.tags.first[0..1].must_equal ['2.0', '6']
          # Avoid millisecond comparision.
          svn.activity.tags.first[-1].strftime('%F %R')
             .must_equal Time.now.utc.strftime('%F %R')
        end
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
ohloh_scm-4.0.4 spec/ohloh_scm/svn/activity_spec.rb
ohloh_scm-4.0.3 spec/ohloh_scm/svn/activity_spec.rb
ohloh_scm-4.0.2 spec/ohloh_scm/svn/activity_spec.rb
ohloh_scm-4.0.1 spec/ohloh_scm/svn/activity_spec.rb
ohloh_scm-3.0.21 spec/ohloh_scm/svn/activity_spec.rb
ohloh_scm-3.0.19 spec/ohloh_scm/svn/activity_spec.rb
ohloh_scm-3.0.17 spec/ohloh_scm/svn/activity_spec.rb
ohloh_scm-3.0.16 spec/ohloh_scm/svn/activity_spec.rb
ohloh_scm-3.0.15 spec/ohloh_scm/svn/activity_spec.rb
ohloh_scm-3.0.14 spec/ohloh_scm/svn/activity_spec.rb
ohloh_scm-3.0.13 spec/ohloh_scm/svn/activity_spec.rb
ohloh_scm-3.0.12 spec/ohloh_scm/svn/activity_spec.rb
ohloh_scm-3.0.11 spec/ohloh_scm/svn/activity_spec.rb
ohloh_scm-3.0.10 spec/ohloh_scm/svn/activity_spec.rb
ohloh_scm-3.0.9 spec/ohloh_scm/svn/activity_spec.rb
ohloh_scm-3.0.8 spec/ohloh_scm/svn/activity_spec.rb
ohloh_scm-3.0.7 spec/ohloh_scm/svn/activity_spec.rb
ohloh_scm-3.0.6 spec/ohloh_scm/svn/activity_spec.rb
ohloh_scm-3.0.5 spec/ohloh_scm/svn/activity_spec.rb
ohloh_scm-3.0.4 spec/ohloh_scm/svn/activity_spec.rb