spec/command_spec.rb in architecture-js-0.1.8 vs spec/command_spec.rb in architecture-js-0.1.9
- old
+ new
@@ -30,31 +30,32 @@
ArchitectureJS::Command.should respond_to :create
end
end
context 'Usage' do
+ before :each do
+ suppress_output { ArchitectureJS::Command.create({ name: 'myapp', root: TMP_DIR }) }
+ end
+
after :each do
FileUtils.rm_rf TMP_DIR
end
it 'should create a new application' do
- suppress_output { ArchitectureJS::Command.create({ name: 'myapp', root: TMP_DIR }) }
-
"#{TMP_DIR}/myapp.architecture".should be_same_file_as "#{FIXTURES}/myapp.architecture"
File.directory?("#{TMP_DIR}/lib").should be_true
File.directory?("#{TMP_DIR}/src").should be_true
end
it 'should compile the application' do
- suppress_output { ArchitectureJS::Command.create({ name: 'myapp', root: TMP_DIR }) }
FileUtils.cp "#{FIXTURES}/lib1.js", "#{TMP_DIR}/src/lib1.js"
FileUtils.cp "#{FIXTURES}/lib2.js", "#{TMP_DIR}/src/lib2.js"
FileUtils.cp "#{FIXTURES}/src_file.js", "#{TMP_DIR}/src/myapp.js"
suppress_output { ArchitectureJS::Command.compile({ path: TMP_DIR }) }
File.exists?("#{TMP_DIR}/lib/myapp.js").should be_true
"#{TMP_DIR}/lib/myapp.js".should be_same_file_as "#{FIXTURES}/compressed.js"
end
-
+
end # Usage
end
\ No newline at end of file