test/unit/test_channel.rb in dropcaster-0.0.8 vs test/unit/test_channel.rb in dropcaster-1.0.0
- old
+ new
@@ -1,5 +1,7 @@
+# frozen_string_literal: true
+
require 'helper'
class TestChannel < MiniTest::Test
include DropcasterTest
@@ -7,11 +9,11 @@
@options = YAML.load_file(File.join(FIXTURES_DIR, Dropcaster::CHANNEL_YML))
@channel = Dropcaster::Channel.new(FIXTURES_DIR, @options)
end
def test_item_count
- assert_equal(1, @channel.items.size)
+ assert_equal(NUMBER_OF_MP3_FILES, @channel.items.size)
end
def test_channel
assert_equal(@options[:title], @channel.title)
assert_equal(@options[:url], @channel.url)
@@ -45,11 +47,13 @@
def test_channel_explicit_no
assert_channel_explicit('No', false)
end
def test_channel_explicit_nil
- assert_channel_explicit(nil, nil)
+ @options[:explicit] = nil
+ channel = Dropcaster::Channel.new(FIXTURES_DIR, @options)
+ assert_nil(channel.explicit)
end
def test_channel_explicit_clean
assert_channel_explicit('Clean', 'Clean')
end
@@ -60,21 +64,21 @@
assert_equal(expected, channel.explicit)
end
def test_raise_on_missing_title
assert_raises Dropcaster::MissingAttributeError do
- Dropcaster::Channel.new(FIXTURES_DIR, {:url => 'bar', :description => 'foobar'})
+ Dropcaster::Channel.new(FIXTURES_DIR, { url: 'bar', description: 'foobar' })
end
end
def test_raise_on_missing_url
assert_raises Dropcaster::MissingAttributeError do
- Dropcaster::Channel.new(FIXTURES_DIR, {:title => 'foo', :description => 'foobar'})
+ Dropcaster::Channel.new(FIXTURES_DIR, { title: 'foo', description: 'foobar' })
end
end
def test_raise_on_missing_description
assert_raises Dropcaster::MissingAttributeError do
- Dropcaster::Channel.new(FIXTURES_DIR, {:title => 'foo', :url => 'bar'})
+ Dropcaster::Channel.new(FIXTURES_DIR, { title: 'foo', url: 'bar' })
end
end
end