Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
François Benaiteau committed Nov 10, 2015
1 parent a4b9585 commit d24157f
Show file tree
Hide file tree
Showing 9 changed files with 1,719 additions and 1,178 deletions.
6 changes: 3 additions & 3 deletions test/babelish/commands/test_command_csv2strings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def test_csv2strings_with_fetch_google_doc
:fetch => true
}

VCR.use_cassette("my_strings_fetch_google_doc") do
mock_google_doc_strings_file do
assert_nothing_raised do
Commandline.new([], options).csv2strings
end
Expand Down Expand Up @@ -69,7 +69,7 @@ def test_csv2strings_with_output_basenames_option
:fetch => true,
:output_basenames => %w(sheet1 sheet2),
}
VCR.use_cassette("my_strings_fetch_google_doc") do
mock_google_doc_strings_file do
Commandline.new([], options).csv2strings
end

Expand All @@ -93,7 +93,7 @@ def test_csv2strings_with_ignore_lang_path_option
:output_basenames => %w(sheet1 sheet2),
}

VCR.use_cassette("my_strings_fetch_google_doc") do
mock_google_doc_strings_file do
Commandline.new([], options).csv2strings
end
# testing
Expand Down
4 changes: 2 additions & 2 deletions test/babelish/test_bins.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
class TestBins < Test::Unit::TestCase

def test_csv2strings_with_google_doc
VCR.use_cassette("my_strings_fetch_google_doc") do
mock_google_doc_strings_file do
assert_nothing_raised do
system("./bin/babelish csv2strings --fetch --filename my_strings \
--langs English:en")
Expand All @@ -12,7 +12,7 @@ def test_csv2strings_with_google_doc
end

def test_csv2strings_with_google_doc_missing_langs
VCR.use_cassette("my_strings_fetch_google_doc") do
mock_google_doc_strings_file do
assert_nothing_raised do
system("./bin/babelish csv2strings --fetch --filename my_strings")
end
Expand Down
2 changes: 1 addition & 1 deletion test/babelish/test_commandline.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def test_csv_download_with_required_params
config_file.write options.to_yaml
config_file.close

VCR.use_cassette("my_strings_fetch_google_doc") do
mock_google_doc_strings_file do
assert_nothing_raised do
Commandline.new.csv_download
end
Expand Down
43 changes: 43 additions & 0 deletions test/babelish/test_google_doc.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
require 'test_helper'
class TestGoogleDoc < Test::Unit::TestCase


# def test_authenticate_without_token
# system "rm .babelish.token"
# gd = Babelish::GoogleDoc.new
# assert_nothing_raised do
# VCR.use_cassette("auth_google_doc") do
# gd.authenticate
# end
# end
# end

# {"refresh_token":"1/UHxZJZhky4MIePnAKlDWpnol-P_rVDTYxNt3h92_ilRIgOrJDtdun6zK6XiATCKT"}

# def test_authenticate_with_refresh_token
# gd = Babelish::GoogleDoc.new
# assert_nothing_raised do
# VCR.use_cassette("refresh_token") do
# gd.authenticate
# end
# end
# end


def test_download_my_strings
gd = Babelish::GoogleDoc.new
# assert_nothing_raised do
# VCR.use_cassette("refresh_token") do
# gd.authenticate
# end
# end
system 'echo {\"refresh_token\":\"fake_token\"} > .babelish.token'
VCR.use_cassette("download_strings") do
VCR.use_cassette("refresh_token") do
gd.download "my_strings"
end
end

end

end
478 changes: 478 additions & 0 deletions test/fixtures/vcr_cassettes/auth_google_doc.yml

Large diffs are not rendered by default.

Loading

0 comments on commit d24157f

Please sign in to comment.