Skip to content

Commit

Permalink
RUB-10 Pass translations in ENV for specs
Browse files Browse the repository at this point in the history
  • Loading branch information
ashish91 committed Oct 13, 2023
1 parent 72bd1dd commit 7e83426
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module CloudProvider

class StubbedTranslatorApi

def initialize(stubbed_translations: 'lib/templates/lib/rubyvernac/stubs')
def initialize(stubbed_translations: 'lib/rubyvernac/stubs')
@stubbed_translations = stubbed_translations
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ class KeywordsTranslator

def initialize(lang_code: , translations_path:, filename:)
@lang_code = lang_code
if ENV['STUB_CLOUD_APIS'] == 'true'
@translator_api = Rubyvernac::CloudProvider::StubbedTranslatorApi.new
if ENV['STUBBED_TRANSLATIONS']
@translator_api = Rubyvernac::CloudProvider::StubbedTranslatorApi.new(stubbed_translations: ENV['STUBBED_TRANSLATIONS'])
else
@translator_api = Rubyvernac::CloudProvider::TranslatorApi.new
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ def initialize(lang_code: , translations_path:, filename:)
@translations_path = translations_path + '/classes'
@filename = filename

if ENV['STUB_CLOUD_APIS'] == 'true'
@translator_api = CloudProvider::StubbedTranslatorApi.new
if ENV['STUBBED_TRANSLATIONS']
@translator_api = CloudProvider::StubbedTranslatorApi.new(stubbed_translations: ENV['STUBBED_TRANSLATIONS'])
else
@translator_api = CloudProvider::TranslatorApi.new
end
Expand Down
2 changes: 1 addition & 1 deletion spec/templates/translator/keywords_translator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

describe "#generate_translations" do
before :all do
ENV['STUB_CLOUD_APIS'] = 'true'
ENV['STUBBED_TRANSLATIONS'] = 'lib/templates/lib/rubyvernac/stubs'
end

it "generates translations" do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

describe "#generate_translations" do
before :all do
ENV['STUB_CLOUD_APIS'] = 'true'
ENV['STUBBED_TRANSLATIONS'] = 'lib/templates/lib/rubyvernac/stubs'
end

it "generates translations" do
Expand Down

0 comments on commit 7e83426

Please sign in to comment.