features/step_definitions/todo_steps.rb in gli-2.12.1 vs features/step_definitions/todo_steps.rb in gli-2.12.2
- old
+ new
@@ -28,32 +28,32 @@
Then /^the config file should contain a section for each command and subcommand$/ do
config = File.open(File.join(ENV['HOME'],'gli_test_todo.rc')) do |file|
YAML::load(file)
end
- config.keys.should include(:flag)
- config[:flag].should == 'foo'
+ expect(config.keys).to include(:flag)
+ expect(config[:flag]).to eq('foo')
config[:flag].tap do |flag|
if flag.respond_to?(:encoding)
- flag.encoding.name.should == 'UTF-8'
+ expect(flag.encoding.name).to eq('UTF-8')
end
end
- config.keys.should include(:switch)
- config[:switch].should == true
- config.keys.should include(:otherswitch)
- config[:otherswitch].should == false
- config.keys.should include('commands')
+ expect(config.keys).to include(:switch)
+ expect(config[:switch]).to eq(true)
+ expect(config.keys).to include(:otherswitch)
+ expect(config[:otherswitch]).to eq(false)
+ expect(config.keys).to include('commands')
%w(chained chained2 create first list ls second).map(&:to_sym).each do |command_name|
- config['commands'].keys.should include(command_name)
+ expect(config['commands'].keys).to include(command_name)
end
- config['commands'][:create].keys.should include('commands')
- config['commands'][:create]['commands'].should include(:tasks)
- config['commands'][:create]['commands'].should include(:contexts)
+ expect(config['commands'][:create].keys).to include('commands')
+ expect(config['commands'][:create]['commands']).to include(:tasks)
+ expect(config['commands'][:create]['commands']).to include(:contexts)
- config['commands'][:list].keys.should include('commands')
- config['commands'][:list]['commands'].should include(:tasks)
- config['commands'][:list]['commands'].should include(:contexts)
+ expect(config['commands'][:list].keys).to include('commands')
+ expect(config['commands'][:list]['commands']).to include(:tasks)
+ expect(config['commands'][:list]['commands']).to include(:contexts)
end
Given /^a config file that specifies defaults for some commands with subcommands$/ do
@config = {
'commands' => {
@@ -75,13 +75,13 @@
end
Then /^I should see the defaults for '(.*)' from the config file in the help$/ do |command_path|
if command_path == 'list tasks'
step %{the output should match /--flag.*default: foobar/}
- unescape(all_output).should_not =~ /#{unescape("--otherflag.*default: crud")}/m
+ expect(unescape(all_output)).not_to match(/#{unescape("--otherflag.*default: crud")}/m)
elsif command_path == 'list contexts'
step %{the output should match /--otherflag.*default: crud/}
- unescape(all_output).should_not =~ /#{unescape("--flag.*default: foobar")}/m
+ expect(unescape(all_output)).not_to match(/#{unescape("--flag.*default: foobar")}/m)
else
raise "Don't know how to test for command path #{command_path}"
end
end