summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2017-04-11 01:16:09 +0000
committerbrian m. carlson <sandals@crustytoothpaste.net>2017-04-11 01:16:09 +0000
commit659682b11292b41188114b6099c55a681189fbf8 (patch)
treeb828a456b0e7f6d73689002d75cc145cd2e12c66
parentb50dd2f2d75235124b157d8e870833afece301c8 (diff)
spec: create test config file for specs
Instead of using the example config file, create a temporary one in spec/fixtures. This allows us to add dummy items that test the code without having to worry about confusing users. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
-rw-r--r--.gitignore2
-rw-r--r--spec/comic_spec.rb2
-rw-r--r--spec/fixtures/config.json22
3 files changed, 24 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
index fe2b637..5fc6338 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,3 @@
/coverage
-config.json
+/config.json
*.html
diff --git a/spec/comic_spec.rb b/spec/comic_spec.rb
index 91d19ad..18cf61a 100644
--- a/spec/comic_spec.rb
+++ b/spec/comic_spec.rb
@@ -7,7 +7,7 @@ describe Comics::Comic do
let(:main_dir) { File.expand_path(File.join(File.dirname(__FILE__), '..')) }
let(:config) do
Comics::Configuration.new(File.new(File.join(main_dir,
- %w[doc/example/config.json])))
+ 'spec/fixtures/config.json')))
end
it 'handles last update times properly' do
diff --git a/spec/fixtures/config.json b/spec/fixtures/config.json
new file mode 100644
index 0000000..d40db03
--- /dev/null
+++ b/spec/fixtures/config.json
@@ -0,0 +1,22 @@
+{
+ "comics":{
+ "dilbert":{
+ "name":"Dilbert",
+ "comics":{
+ "daily":{
+ "website": "http://www.dilbert.com/strips/comic/",
+ "link": "http://www.dilbert.com/strips/comic/%F/",
+ "type":"link",
+ "frequency":"daily",
+ "time":"12:00"
+ }
+ }
+ }
+ },
+ "config": {
+ "id":"https://comics.crustytoothpaste.net/",
+ "css":"//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css",
+ "default":{
+ }
+ }
+}