Skip to content

Commit

Permalink
Rename Command#run to Command#runs to avoid command property
Browse files Browse the repository at this point in the history
  • Loading branch information
iain committed Jun 16, 2012
1 parent f9ed8b7 commit 28a18c4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions README.md
Expand Up @@ -63,25 +63,25 @@ The file generated contains configuration on which commands can be ran. Here is
TestSuite.configure do |config|

config.command :bundler do |cmd|
cmd.run "bundle check || bundle install" # what should be run
cmd.runs "bundle check || bundle install" # what should be run
cmd.fails_build_immediately!
end

config.command :migrate do |cmd|
cmd.run "bundle exec rake RAILS_ENV=test db:migrate:reset > /log/migrate.log"
cmd.runs "bundle exec rake RAILS_ENV=test db:migrate:reset > /log/migrate.log"
cmd.fails_build_immediately!
end

config.command :rspec do |cmd|
cmd.run "bundle exec rspec --format progress --format html --out rspec.html"
cmd.runs "bundle exec rspec --format progress --format html --out rspec.html"
end

config.command :cucumber do |cmd|
cmd.run "bundle exec cucumber"
cmd.runs "bundle exec cucumber"
end

config.command :brakeman do |cmd|
cmd.run "brakeman"
cmd.runs "brakeman"
cmd.never_fails_build!
end

Expand Down
8 changes: 4 additions & 4 deletions lib/test_suite/command.rb
Expand Up @@ -8,12 +8,12 @@ def initialize(name, &block)
@name = name
end

def run(command)
@command = command
def runs(run)
@run = run
end

def command
@command || name.to_s
def run
@run || name.to_s
end

def important?
Expand Down
6 changes: 3 additions & 3 deletions spec/test_suite/command_spec.rb
Expand Up @@ -11,12 +11,12 @@

it "can receive a command" do
cmd = "ls -alh"
command.run cmd
command.command.should be cmd
command.runs cmd
command.run.should be cmd
end

it "uses the name as a command" do
command.command.should eq "name"
command.run.should eq "name"
end

it "is not important to fail the build immediately" do
Expand Down

0 comments on commit 28a18c4

Please sign in to comment.