File tree Expand file tree Collapse file tree 4 files changed +51
-28
lines changed Expand file tree Collapse file tree 4 files changed +51
-28
lines changed Original file line number Diff line number Diff line change 1
1
require 'rake'
2
+ require 'rake/testtask'
2
3
require 'rubygems/package_task'
3
4
4
5
begin
9
10
spec . authors = [ "James Coglan" , "Kevin Menard" ]
10
11
spec . homepage = "https://github.com/nirvdrum/svn2git"
11
12
13
+ spec . add_development_dependency 'test-unit'
12
14
end
13
15
Jeweler ::GemcutterTasks . new
14
16
15
17
rescue LoadError
16
18
puts "Jeweler not available. Install it with: gem install jeweler"
17
19
end
18
-
19
- #
20
- # spec = Gem::Specification.new do |spec|
21
- #
22
- # spec.version = "1.1.0"
23
- # spec.platform = Gem::Platform::RUBY
24
- #
25
- #
26
- # spec.require_path = "lib"
27
- # spec.files = FileList["lib/**/*"].to_a
28
- # spec.autorequire = "lib/svn2git.rb"
29
- # spec.bindir = "bin"
30
- # spec.executables = ["svn2git"]
31
- # spec.default_executable = "svn2git"
32
- #
33
- #
34
- #
35
- #
36
- # spec.test_files = FileList["test/**/*"].to_a
37
- # spec.has_rdoc = true
38
- # spec.extra_rdoc_files = ["README"]
39
- # spec.rdoc_options << "--main" << "README" << '--line-numbers' << '--inline-source'
40
- # end
41
- #
42
- # Rake::GemPackageTask.new(spec) do |pkg|
43
- # pkg.need_tar = true
44
- # end
45
- #
20
+
21
+ desc 'Test the rubber plugin.'
22
+ Rake ::TestTask . new ( :test ) do |t |
23
+ t . libs << 'lib'
24
+ t . libs << 'test'
25
+ t . pattern = 'test/**/*_test.rb'
26
+ t . verbose = true
27
+ end
28
+
29
+ desc 'Default: run unit tests.'
30
+ task :default => :test
Original file line number Diff line number Diff line change @@ -32,5 +32,17 @@ Gem::Specification.new do |s|
32
32
s . homepage = "https://github.com/nirvdrum/svn2git"
33
33
s . rubygems_version = "2.2.2"
34
34
s . summary = "A tool for migrating svn projects to git"
35
+
36
+ if s . respond_to? :specification_version then
37
+ s . specification_version = 4
38
+
39
+ if Gem ::Version . new ( Gem ::VERSION ) >= Gem ::Version . new ( '1.2.0' ) then
40
+ s . add_development_dependency ( %q<test-unit> , [ ">= 0" ] )
41
+ else
42
+ s . add_dependency ( %q<test-unit> , [ ">= 0" ] )
43
+ end
44
+ else
45
+ s . add_dependency ( %q<test-unit> , [ ">= 0" ] )
46
+ end
35
47
end
36
48
Original file line number Diff line number Diff line change
1
+ require File . expand_path ( File . join ( __FILE__ , '..' , 'test_helper' ) )
2
+
3
+ class EscapeQuotesTest < Test ::Unit ::TestCase
4
+ def test_identity
5
+ expected = 'A string without any need to escape.'
6
+ actual = Svn2Git ::Migration . escape_quotes ( expected )
7
+
8
+ assert_equal expected , actual
9
+ end
10
+
11
+ def test_escape_single_quotes
12
+ actual = Svn2Git ::Migration . escape_quotes ( "Here's a message with 'single quotes.'" )
13
+
14
+ assert_equal "Here\\ 's a message with \\ 'single quotes.\\ '" , actual
15
+ end
16
+
17
+ def test_escape_double_quotes
18
+ actual = Svn2Git ::Migration . escape_quotes ( 'Here is a message with "double quotes."' )
19
+
20
+ assert_equal 'Here is a message with \\"double quotes.\\"' , actual
21
+ end
22
+ end
Original file line number Diff line number Diff line change
1
+ $:. unshift "#{ File . dirname ( __FILE__ ) } /../lib"
2
+
3
+ require 'svn2git'
4
+ require 'test/unit'
You can’t perform that action at this time.
0 commit comments