From 28a18c498880f41e7337ef06872413717d844db2 Mon Sep 17 00:00:00 2001 From: iain Date: Sat, 16 Jun 2012 18:16:32 +0200 Subject: [PATCH] Rename Command#run to Command#runs to avoid command property --- README.md | 10 +++++----- lib/test_suite/command.rb | 8 ++++---- spec/test_suite/command_spec.rb | 6 +++--- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index fb599c1..f3cd247 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/lib/test_suite/command.rb b/lib/test_suite/command.rb index eac1a92..ca389ac 100644 --- a/lib/test_suite/command.rb +++ b/lib/test_suite/command.rb @@ -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? diff --git a/spec/test_suite/command_spec.rb b/spec/test_suite/command_spec.rb index 3fc82ba..c99f63d 100644 --- a/spec/test_suite/command_spec.rb +++ b/spec/test_suite/command_spec.rb @@ -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