Skip to content

Instantly share code, notes, and snippets.

@kbaird
Created February 14, 2009 01:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kbaird/64212 to your computer and use it in GitHub Desktop.
Save kbaird/64212 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
# libertarianism_made_easy.rb
module LibertarianismMadeEasy
attr_accessor :is_government
def acceptable_to?(some_action)
not is_government
end
end
Object.send(:include, LibertarianismMadeEasy)
if (__FILE__ == $0)
require %q[rubygems]
require %q[spec]
describe LibertarianismMadeEasy do
before(:each) do
@the_state, @private_citizen = Object.new, Object.new
@the_state.is_government = true
@private_citizen.is_government = false
end
describe %q[feeding homeless people] do
before(:each) do
@action = %q[feed homeless people]
end
it %q[should be permissable to private citizens] do
@private_citizen.acceptable_to?(@action).should be_true
end
it %q[should not be permissable to the State] do
@the_state.acceptable_to?(@action).should be_false
end
end
describe %q[shooting trespassers] do
before(:each) do
@action = %q[shoot trespassers]
end
it %q[should be permissable to private citizens] do
@private_citizen.acceptable_to?(@action).should be_true
end
it %q[should not be permissable to the State] do
@the_state.acceptable_to?(@action).should be_false
end
end
describe %q[banning smoking in restaurants] do
before(:each) do
@action = %q[ban smoking in restaurants]
end
it %q[should be permissable to private citizens] do
@private_citizen.acceptable_to?(@action).should be_true
end
it %q[should not be permissable to the State] do
@the_state.acceptable_to?(@action).should be_false
end
end
describe %q[buying and selling humans as chattel slaves] do
before(:each) do
@action = %q[buy and sell humans as slaves]
end
it %q[should be permissable to private citizens] do
@private_citizen.acceptable_to?(@action).should be_true
end
it %q[should not be permissable to the State] do
@the_state.acceptable_to?(@action).should be_false
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment