Skip to content

Commit

Permalink
extended example_bacon.rb example
Browse files Browse the repository at this point in the history
  • Loading branch information
banister committed Feb 10, 2012
1 parent 7751f29 commit b323903
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
8 changes: 8 additions & 0 deletions examples/example_bacon.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,12 @@
it 'should be empty' do
@array.empty?.should == true
end

it 'should have 3 items' do
[1, 2, 3].size.should == 3
end

it 'should contain only numbers' do
[1, "2", 3].all? { |v| v.is_a?(Fixnum).should == true }
end
end
28 changes: 28 additions & 0 deletions lib/plymouth/commands.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
module Plymouth
Commands = Pry::CommandSet.new do
create_command "plymouth-off", "Disable Plymouth." do
banner <<-BANNER
Usage: plymouth-off
Exit the REPL and turn Plymouth off for the duration of the test suite.
BANNER

def process
Plymouth.disable!

# exit the REPL
run "exit-all"
end
end

create_command "plymouth-on", "Enable Plymouth." do
banner <<-BANNER
Usage: plymouth-off
Enable Plymouth.
BANNER

def process
Plymouth.enable!
end
end
end
end

0 comments on commit b323903

Please sign in to comment.