test/extra/deployers/test_fog.rb in nanoc-3.7.4 vs test/extra/deployers/test_fog.rb in nanoc-3.7.5
- old
+ new
@@ -1,18 +1,17 @@
# encoding: utf-8
class Nanoc::Extra::Deployers::FogTest < Nanoc::TestCase
-
def test_run
if_have 'fog' do
# Create deployer
fog = Nanoc::Extra::Deployers::Fog.new(
'output/',
{
- :bucket => 'mybucket',
- :provider => 'local',
- :local_root => 'mylocalcloud'})
+ bucket: 'mybucket',
+ provider: 'local',
+ local_root: 'mylocalcloud' })
# Create site
FileUtils.mkdir_p('output')
File.open('output/meow', 'w') { |io| io.write 'I am a cat!' }
File.open('output/bark', 'w') { |io| io.write 'I am a dog!' }
@@ -36,16 +35,16 @@
begin
# Create deployer
fog = Nanoc::Extra::Deployers::Fog.new(
'output/',
{
- :provider => 'aws',
- # FIXME bucket is necessary for deployer but fog doesn't like it
- :bucket_name => 'doesntmatter',
- :aws_access_key_id => 'meh',
- :aws_secret_access_key => 'dontcare'},
- :dry_run => true)
+ provider: 'aws',
+ # FIXME: bucket is necessary for deployer but fog doesn't like it
+ bucket_name: 'doesntmatter',
+ aws_access_key_id: 'meh',
+ aws_secret_access_key: 'dontcare' },
+ dry_run: true)
# Create site
FileUtils.mkdir_p('output')
File.open('output/meow', 'w') { |io| io.write 'I am a cat!' }
File.open('output/bark', 'w') { |io| io.write 'I am a dog!' }
@@ -54,11 +53,11 @@
FileUtils.mkdir_p('mylocalcloud')
# Run
fog.run
ensure
- # Hack :(
+ # FIXME: ugly hack
::Fog.instance_eval { @mocking = false }
end
end
end
@@ -66,13 +65,13 @@
if_have 'fog' do
# Create deployer
fog = Nanoc::Extra::Deployers::Fog.new(
'output/',
{
- :bucket => 'mybucket',
- :provider => 'local',
- :local_root => 'mylocalcloud'})
+ bucket: 'mybucket',
+ provider: 'local',
+ local_root: 'mylocalcloud' })
# Setup fake local cloud
FileUtils.mkdir_p('mylocalcloud/mybucket')
File.open('mylocalcloud/mybucket/etc', 'w') { |io| io.write('meh-etc') }
File.open('mylocalcloud/mybucket/meow', 'w') { |io| io.write('meh-meow') }
@@ -95,7 +94,6 @@
assert File.file?('mylocalcloud/mybucket/bark')
assert_equal 'I am a cat!', File.read('mylocalcloud/mybucket/meow')
assert_equal 'I am a dog!', File.read('mylocalcloud/mybucket/bark')
end
end
-
end