aboutsummaryrefslogtreecommitdiffstats
path: root/spec/lib/tom_tom_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib/tom_tom_spec.rb')
-rw-r--r--spec/lib/tom_tom_spec.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/lib/tom_tom_spec.rb b/spec/lib/tom_tom_spec.rb
new file mode 100644
index 000000000..71584e242
--- /dev/null
+++ b/spec/lib/tom_tom_spec.rb
@@ -0,0 +1,15 @@
+RSpec.describe TomTom do
+ describe ".enabled?" do
+ it "returns true when API key is set" do
+ TomTom.instance_variable_set(:@api_key, 'fake key')
+
+ expect(TomTom.enabled?).to be true
+ end
+
+ it "returns false without an API key" do
+ TomTom.instance_variable_set(:@api_key, '')
+
+ expect(TomTom.enabled?).to be false
+ end
+ end
+end