sinatra-switch 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -28,10 +28,14 @@ module Sinatra
28
28
 
29
29
  post "/switch/#{app_name}/on" do
30
30
  File.open(file, 'w') {|f| f.write(on_message) }
31
+ status 200
32
+ "#{app_name} set to #{on_message}..."
31
33
  end
32
34
 
33
35
  post "/switch/#{app_name}/off" do
34
36
  File.open(file, 'w') {|f| f.write(off_message) }
37
+ status 200
38
+ "#{app_name} set to #{off_message}..."
35
39
  end
36
40
  end
37
41
  end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "sinatra-switch"
3
- s.version = "0.0.4"
3
+ s.version = "0.0.5"
4
4
  s.date = "2014-10-28"
5
5
  s.summary = "Set and retrieve an arbitrary switch."
6
6
  s.description = "Set and retrieve an arbitrary switch flag via get and post."
data/test/switch_test.rb CHANGED
@@ -41,6 +41,8 @@ class SinatraSwitchTest < Test::Unit::TestCase
41
41
 
42
42
  def test_it_can_be_set_to_off
43
43
  @session.post "/switch/light/off"
44
+ assert_equal @session.last_response.status, 200
45
+
44
46
  @session.get "/switch/light"
45
47
  assert_equal @session.last_response.status, 400
46
48
  assert_include @session.last_response.body, "light is OFF"
@@ -49,6 +51,8 @@ class SinatraSwitchTest < Test::Unit::TestCase
49
51
  def test_it_can_be_set_to_on
50
52
  @session.post "/switch/light/off"
51
53
  @session.post "/switch/light/on"
54
+ assert_equal @session.last_response.status, 200
55
+
52
56
  @session.get "/switch/light"
53
57
  assert_equal @session.last_response.status, 200
54
58
  assert_include @session.last_response.body, "light is ON"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinatra-switch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -52,7 +52,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
52
52
  version: '0'
53
53
  segments:
54
54
  - 0
55
- hash: -3401378227648049844
55
+ hash: 2074841067721576988
56
56
  required_rubygems_version: !ruby/object:Gem::Requirement
57
57
  none: false
58
58
  requirements: