[Rake] step_pattern / feature_pattern deprecated warning

3 views
Skip to first unread message

Brandon Faloona

unread,
Jul 24, 2009, 3:20:39 PM7/24/09
to Cukes
I'm using rake with cucumber profiles to launch cucumber. Should I do
anything to avoid the warning below, or just ignore it?

WARNING: Cucumber::Rake::Task#step_pattern is deprecated and will be
removed in 0.4.0. Please use profiles for complex settings:
http://wiki.github.com/aslakhellesoy/cucumber/using-rake#profiles

Here's my config:
@@@
# cucumber.yml
bvt: --no-diff --format html --out suite_results.htm --format progress
test\features\bvt\v001\bvt\

# rakefile
namespace :run do

ENV['CUCUMBER_COLORS'] = 'failed=magenta:failed_param=magenta'

Cucumber::Rake::Task.new(:bvt, 'Run bvt automation') do |t|
t.profile = "bvt"
end
...
end
@@@

Ben Mabey

unread,
Jul 24, 2009, 3:50:38 PM7/24/09
to cu...@googlegroups.com

Hmm.. That is odd that you are seeing that warning without using
#step_pattern= in your task... Very odd. I can't really explain why you
are seeing that without stepping through the code. The warning should
only be issued when you use #step_pattern= Here is the code
(lib/cucumber/task.rb:88-96):

def self.deprecate_accessor(attribute) # :nodoc:
attr_reader attribute
class_eval <<-EOF, __FILE__, __LINE__ + 1
def #{attribute}=(value)
@#{attribute} = value
warn("\nWARNING: Cucumber::Rake::Task##{attribute} is

deprecated and will be removed in 0.4.0. Please use profiles for
complex settings:

http://wiki.github.com/aslakhellesoy/cucumber/using-rake#profiles\n")
end
EOF
end

Would you mind stepping though to see who is using the #step_pattern=
method? That is the only way we can figure out how to avoid the message.

-Ben

Brandon Faloona

unread,
Jul 24, 2009, 4:00:48 PM7/24/09
to Cukes
Thanks ben, I'll open a watircraft bug.

\lib\ruby\gems\1.8\gems\bret-watircraft-0.5.0\lib\taza\tasks.rb:26

Cucumber::Rake::Task.new do |t|
t.cucumber_opts = '--format pretty'
t.step_pattern = "lib/steps/**/*.rb"
t.feature_pattern = "test/features/**/*.feature"
end

Ben Mabey

unread,
Jul 24, 2009, 4:08:00 PM7/24/09
to cu...@googlegroups.com


If they don't want to use profiles I would suggest just using the following:

Cucumber::Rake::Task.new do |t|

t.cucumber_opts = '--format pretty --require lib/steps test/features"
end


FYI, the motivation for deprecating these accessors on the Rake task is to avoid duplication of logic in Cucumber, simplify the rake task logic, and encourage people to use the powerful command line options instead (in conjunction with profiles when appropriate).

-Ben


Reply all
Reply to author
Forward
0 new messages