spec/application_spec.rb in rformat-0.1.0 vs spec/application_spec.rb in rformat-0.1.1
- old
+ new
@@ -17,11 +17,11 @@
end
it "outputs a list of the available formatters" do
output.should_receive(:puts).with("Formatters:")
output.should_receive(:puts).with(env.formatters.keys.map { |f| " #{f}\n" })
- app.list []
+ app.list
end
it "outputs the version with copyright information" do
version = File.read(File.join(RFormat::root_dir, 'VERSION'))
copyright = "Copyright (c) 2012 Dayton Nolan\n"
@@ -30,13 +30,15 @@
app.version
end
it "can parse the command from an args array" do
ARGV = ['list']
- expect(app.parse_command).to eq(:list)
+ a = RFormat::Application.new
+ expect(a.parse_command).to eq(:list)
ARGV = ['nyan', 'unicorn']
- expect(app.parse_command).to eq(:write)
+ b = RFormat::Application.new
+ expect(b.parse_command).to eq(:write)
end
it "doesn't count subcommands as arguments" do
ARGV = ['list']
list_example = RFormat::Application.new(StringIO.new, RFormat::Environment.new)
@@ -75,16 +77,18 @@
end
end
it "should run the write command" do
ARGV = ['nyan', 'unicorn']
- app.should_receive(:write).with(['nyan', 'unicorn'])
- app.run
+ a = RFormat::Application.new
+ a.should_receive(:write).with(['nyan', 'unicorn'])
+ a.run
end
it "should run the list command" do
ARGV = ['list']
- app.should_receive(:list).with([])
- app.run
+ a = RFormat::Application.new
+ a.should_receive(:list)
+ a.run
end
end
\ No newline at end of file